﻿using System;
using System.Collections;
using System.Data;
using System.Data.OleDb;
using System.Linq;
using System.Windows.Forms;
using C1.Win.C1Input;
using C1.Win.C1TrueDBGrid;
using PCSComProduct.Items.BO;
using PCSComUtils.Common;
using PCSComUtils.Common.BO;
using PCSComUtils.PCSExc;
using PCSUtils.Log;
using PCSUtils.Utils;
using System.Collections.Generic;
using PCSComUtils.DataContext;

namespace PCSProduct.Items
{
    /// <summary>
    /// Summary description for Form1.
    /// </summary>
    public class Bom : System.Windows.Forms.Form
    {
        private System.Windows.Forms.Button btnHelp;
        private System.Windows.Forms.Button btnDelete;
        private System.Windows.Forms.Button btnSave;
        private System.Windows.Forms.Button btnAdd;
        private System.Windows.Forms.Button btnEdit;
        private System.Windows.Forms.Button btnOK;
        private System.Windows.Forms.Button btnFindItem;
        private System.Windows.Forms.Label lblRevision;
        private System.Windows.Forms.TextBox txtItemCode;
        private C1.Win.C1List.C1Combo cboCCN;
        private System.Windows.Forms.CheckBox chkMakeItem;
        private System.Windows.Forms.TextBox txtBOMDes;
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.Container components = null;

        private const string THIS = "PCSProduct.Items.Bom";

        private string StockUMCode = "StockCode";
        private string WorkCenterCode = "WorkCenterCode";
        private string CaptionLine = "Line";
        private string CaptionOperation = "Operation";
        private C1.Win.C1Input.C1DateEdit dtmEffectiveDate;

        private DataSet dstBOMDetail = new DataSet();
        public ITM_Product voProduct = new ITM_Product();

        private int intRowCountDelete = 0;
        private EnumAction enumAction = EnumAction.Default;
        private bool blnHasError = false;
        private C1.Win.C1TrueDBGrid.C1TrueDBGrid dgrdData;
        private System.Windows.Forms.TextBox txtModel;
        private System.Windows.Forms.TextBox txtPartName;
        private C1.Win.C1Input.C1NumericEdit txtIncrement;
        private DataTable dtbGridLayout;
        private System.Windows.Forms.TextBox txtWorkCenter;
        private System.Windows.Forms.Label lblWorkcenter;
        private System.Windows.Forms.Label lblCCN;
        private System.Windows.Forms.Label lblPartName;
        private System.Windows.Forms.Label lblPartNumber;
        private System.Windows.Forms.Label lblBomDes;
        private System.Windows.Forms.Label lblIncre;
        private const string DECIMAL_NUMBERFORMAT_SMALL = "##############,0.00000";

        public Bom()
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            //
            // TODO: Add any constructor code after InitializeComponent call
            //
        }

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Bom));
            this.btnEdit = new System.Windows.Forms.Button();
            this.btnOK = new System.Windows.Forms.Button();
            this.btnHelp = new System.Windows.Forms.Button();
            this.btnDelete = new System.Windows.Forms.Button();
            this.btnSave = new System.Windows.Forms.Button();
            this.btnAdd = new System.Windows.Forms.Button();
            this.dgrdData = new C1.Win.C1TrueDBGrid.C1TrueDBGrid();
            this.cboCCN = new C1.Win.C1List.C1Combo();
            this.lblCCN = new System.Windows.Forms.Label();
            this.btnFindItem = new System.Windows.Forms.Button();
            this.lblRevision = new System.Windows.Forms.Label();
            this.lblPartName = new System.Windows.Forms.Label();
            this.lblPartNumber = new System.Windows.Forms.Label();
            this.lblBomDes = new System.Windows.Forms.Label();
            this.lblIncre = new System.Windows.Forms.Label();
            this.chkMakeItem = new System.Windows.Forms.CheckBox();
            this.txtItemCode = new System.Windows.Forms.TextBox();
            this.txtBOMDes = new System.Windows.Forms.TextBox();
            this.dtmEffectiveDate = new C1.Win.C1Input.C1DateEdit();
            this.txtModel = new System.Windows.Forms.TextBox();
            this.txtPartName = new System.Windows.Forms.TextBox();
            this.txtIncrement = new C1.Win.C1Input.C1NumericEdit();
            this.txtWorkCenter = new System.Windows.Forms.TextBox();
            this.lblWorkcenter = new System.Windows.Forms.Label();
            ((System.ComponentModel.ISupportInitialize)(this.dgrdData)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.cboCCN)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.dtmEffectiveDate)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.txtIncrement)).BeginInit();
            this.SuspendLayout();
            // 
            // btnEdit
            // 
            this.btnEdit.AccessibleDescription = resources.GetString("btnEdit.AccessibleDescription");
            this.btnEdit.AccessibleName = resources.GetString("btnEdit.AccessibleName");
            this.btnEdit.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("btnEdit.Anchor")));
            this.btnEdit.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnEdit.BackgroundImage")));
            this.btnEdit.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("btnEdit.Dock")));
            this.btnEdit.Enabled = ((bool)(resources.GetObject("btnEdit.Enabled")));
            this.btnEdit.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("btnEdit.FlatStyle")));
            this.btnEdit.Font = ((System.Drawing.Font)(resources.GetObject("btnEdit.Font")));
            this.btnEdit.Image = ((System.Drawing.Image)(resources.GetObject("btnEdit.Image")));
            this.btnEdit.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnEdit.ImageAlign")));
            this.btnEdit.ImageIndex = ((int)(resources.GetObject("btnEdit.ImageIndex")));
            this.btnEdit.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("btnEdit.ImeMode")));
            this.btnEdit.Location = ((System.Drawing.Point)(resources.GetObject("btnEdit.Location")));
            this.btnEdit.Name = "btnEdit";
            this.btnEdit.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("btnEdit.RightToLeft")));
            this.btnEdit.Size = ((System.Drawing.Size)(resources.GetObject("btnEdit.Size")));
            this.btnEdit.TabIndex = ((int)(resources.GetObject("btnEdit.TabIndex")));
            this.btnEdit.Text = resources.GetString("btnEdit.Text");
            this.btnEdit.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnEdit.TextAlign")));
            this.btnEdit.Visible = ((bool)(resources.GetObject("btnEdit.Visible")));
            this.btnEdit.Click += new System.EventHandler(this.btnEdit_Click);
            // 
            // btnOK
            // 
            this.btnOK.AccessibleDescription = resources.GetString("btnOK.AccessibleDescription");
            this.btnOK.AccessibleName = resources.GetString("btnOK.AccessibleName");
            this.btnOK.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("btnOK.Anchor")));
            this.btnOK.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnOK.BackgroundImage")));
            this.btnOK.DialogResult = System.Windows.Forms.DialogResult.OK;
            this.btnOK.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("btnOK.Dock")));
            this.btnOK.Enabled = ((bool)(resources.GetObject("btnOK.Enabled")));
            this.btnOK.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("btnOK.FlatStyle")));
            this.btnOK.Font = ((System.Drawing.Font)(resources.GetObject("btnOK.Font")));
            this.btnOK.Image = ((System.Drawing.Image)(resources.GetObject("btnOK.Image")));
            this.btnOK.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnOK.ImageAlign")));
            this.btnOK.ImageIndex = ((int)(resources.GetObject("btnOK.ImageIndex")));
            this.btnOK.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("btnOK.ImeMode")));
            this.btnOK.Location = ((System.Drawing.Point)(resources.GetObject("btnOK.Location")));
            this.btnOK.Name = "btnOK";
            this.btnOK.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("btnOK.RightToLeft")));
            this.btnOK.Size = ((System.Drawing.Size)(resources.GetObject("btnOK.Size")));
            this.btnOK.TabIndex = ((int)(resources.GetObject("btnOK.TabIndex")));
            this.btnOK.Text = resources.GetString("btnOK.Text");
            this.btnOK.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnOK.TextAlign")));
            this.btnOK.Visible = ((bool)(resources.GetObject("btnOK.Visible")));
            this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
            // 
            // btnHelp
            // 
            this.btnHelp.AccessibleDescription = resources.GetString("btnHelp.AccessibleDescription");
            this.btnHelp.AccessibleName = resources.GetString("btnHelp.AccessibleName");
            this.btnHelp.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("btnHelp.Anchor")));
            this.btnHelp.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnHelp.BackgroundImage")));
            this.btnHelp.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("btnHelp.Dock")));
            this.btnHelp.Enabled = ((bool)(resources.GetObject("btnHelp.Enabled")));
            this.btnHelp.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("btnHelp.FlatStyle")));
            this.btnHelp.Font = ((System.Drawing.Font)(resources.GetObject("btnHelp.Font")));
            this.btnHelp.Image = ((System.Drawing.Image)(resources.GetObject("btnHelp.Image")));
            this.btnHelp.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnHelp.ImageAlign")));
            this.btnHelp.ImageIndex = ((int)(resources.GetObject("btnHelp.ImageIndex")));
            this.btnHelp.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("btnHelp.ImeMode")));
            this.btnHelp.Location = ((System.Drawing.Point)(resources.GetObject("btnHelp.Location")));
            this.btnHelp.Name = "btnHelp";
            this.btnHelp.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("btnHelp.RightToLeft")));
            this.btnHelp.Size = ((System.Drawing.Size)(resources.GetObject("btnHelp.Size")));
            this.btnHelp.TabIndex = ((int)(resources.GetObject("btnHelp.TabIndex")));
            this.btnHelp.Text = resources.GetString("btnHelp.Text");
            this.btnHelp.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnHelp.TextAlign")));
            this.btnHelp.Visible = ((bool)(resources.GetObject("btnHelp.Visible")));
            // 
            // btnDelete
            // 
            this.btnDelete.AccessibleDescription = resources.GetString("btnDelete.AccessibleDescription");
            this.btnDelete.AccessibleName = resources.GetString("btnDelete.AccessibleName");
            this.btnDelete.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("btnDelete.Anchor")));
            this.btnDelete.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnDelete.BackgroundImage")));
            this.btnDelete.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("btnDelete.Dock")));
            this.btnDelete.Enabled = ((bool)(resources.GetObject("btnDelete.Enabled")));
            this.btnDelete.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("btnDelete.FlatStyle")));
            this.btnDelete.Font = ((System.Drawing.Font)(resources.GetObject("btnDelete.Font")));
            this.btnDelete.Image = ((System.Drawing.Image)(resources.GetObject("btnDelete.Image")));
            this.btnDelete.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnDelete.ImageAlign")));
            this.btnDelete.ImageIndex = ((int)(resources.GetObject("btnDelete.ImageIndex")));
            this.btnDelete.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("btnDelete.ImeMode")));
            this.btnDelete.Location = ((System.Drawing.Point)(resources.GetObject("btnDelete.Location")));
            this.btnDelete.Name = "btnDelete";
            this.btnDelete.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("btnDelete.RightToLeft")));
            this.btnDelete.Size = ((System.Drawing.Size)(resources.GetObject("btnDelete.Size")));
            this.btnDelete.TabIndex = ((int)(resources.GetObject("btnDelete.TabIndex")));
            this.btnDelete.Text = resources.GetString("btnDelete.Text");
            this.btnDelete.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnDelete.TextAlign")));
            this.btnDelete.Visible = ((bool)(resources.GetObject("btnDelete.Visible")));
            this.btnDelete.Click += new System.EventHandler(this.btnDelete_Click);
            // 
            // btnSave
            // 
            this.btnSave.AccessibleDescription = resources.GetString("btnSave.AccessibleDescription");
            this.btnSave.AccessibleName = resources.GetString("btnSave.AccessibleName");
            this.btnSave.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("btnSave.Anchor")));
            this.btnSave.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnSave.BackgroundImage")));
            this.btnSave.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("btnSave.Dock")));
            this.btnSave.Enabled = ((bool)(resources.GetObject("btnSave.Enabled")));
            this.btnSave.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("btnSave.FlatStyle")));
            this.btnSave.Font = ((System.Drawing.Font)(resources.GetObject("btnSave.Font")));
            this.btnSave.Image = ((System.Drawing.Image)(resources.GetObject("btnSave.Image")));
            this.btnSave.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnSave.ImageAlign")));
            this.btnSave.ImageIndex = ((int)(resources.GetObject("btnSave.ImageIndex")));
            this.btnSave.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("btnSave.ImeMode")));
            this.btnSave.Location = ((System.Drawing.Point)(resources.GetObject("btnSave.Location")));
            this.btnSave.Name = "btnSave";
            this.btnSave.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("btnSave.RightToLeft")));
            this.btnSave.Size = ((System.Drawing.Size)(resources.GetObject("btnSave.Size")));
            this.btnSave.TabIndex = ((int)(resources.GetObject("btnSave.TabIndex")));
            this.btnSave.Text = resources.GetString("btnSave.Text");
            this.btnSave.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnSave.TextAlign")));
            this.btnSave.Visible = ((bool)(resources.GetObject("btnSave.Visible")));
            this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
            // 
            // btnAdd
            // 
            this.btnAdd.AccessibleDescription = resources.GetString("btnAdd.AccessibleDescription");
            this.btnAdd.AccessibleName = resources.GetString("btnAdd.AccessibleName");
            this.btnAdd.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("btnAdd.Anchor")));
            this.btnAdd.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnAdd.BackgroundImage")));
            this.btnAdd.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("btnAdd.Dock")));
            this.btnAdd.Enabled = ((bool)(resources.GetObject("btnAdd.Enabled")));
            this.btnAdd.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("btnAdd.FlatStyle")));
            this.btnAdd.Font = ((System.Drawing.Font)(resources.GetObject("btnAdd.Font")));
            this.btnAdd.Image = ((System.Drawing.Image)(resources.GetObject("btnAdd.Image")));
            this.btnAdd.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnAdd.ImageAlign")));
            this.btnAdd.ImageIndex = ((int)(resources.GetObject("btnAdd.ImageIndex")));
            this.btnAdd.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("btnAdd.ImeMode")));
            this.btnAdd.Location = ((System.Drawing.Point)(resources.GetObject("btnAdd.Location")));
            this.btnAdd.Name = "btnAdd";
            this.btnAdd.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("btnAdd.RightToLeft")));
            this.btnAdd.Size = ((System.Drawing.Size)(resources.GetObject("btnAdd.Size")));
            this.btnAdd.TabIndex = ((int)(resources.GetObject("btnAdd.TabIndex")));
            this.btnAdd.Text = resources.GetString("btnAdd.Text");
            this.btnAdd.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnAdd.TextAlign")));
            this.btnAdd.Visible = ((bool)(resources.GetObject("btnAdd.Visible")));
            this.btnAdd.Click += new System.EventHandler(this.btnAdd_Click);
            // 
            // dgrdData
            // 
            this.dgrdData.AccessibleDescription = resources.GetString("dgrdData.AccessibleDescription");
            this.dgrdData.AccessibleName = resources.GetString("dgrdData.AccessibleName");
            this.dgrdData.AllowAddNew = ((bool)(resources.GetObject("dgrdData.AllowAddNew")));
            this.dgrdData.AllowArrows = ((bool)(resources.GetObject("dgrdData.AllowArrows")));
            this.dgrdData.AllowColMove = ((bool)(resources.GetObject("dgrdData.AllowColMove")));
            this.dgrdData.AllowColSelect = ((bool)(resources.GetObject("dgrdData.AllowColSelect")));
            this.dgrdData.AllowDelete = ((bool)(resources.GetObject("dgrdData.AllowDelete")));
            this.dgrdData.AllowDrag = ((bool)(resources.GetObject("dgrdData.AllowDrag")));
            this.dgrdData.AllowFilter = ((bool)(resources.GetObject("dgrdData.AllowFilter")));
            this.dgrdData.AllowHorizontalSplit = ((bool)(resources.GetObject("dgrdData.AllowHorizontalSplit")));
            this.dgrdData.AllowRowSelect = ((bool)(resources.GetObject("dgrdData.AllowRowSelect")));
            this.dgrdData.AllowSort = ((bool)(resources.GetObject("dgrdData.AllowSort")));
            this.dgrdData.AllowUpdate = ((bool)(resources.GetObject("dgrdData.AllowUpdate")));
            this.dgrdData.AllowUpdateOnBlur = ((bool)(resources.GetObject("dgrdData.AllowUpdateOnBlur")));
            this.dgrdData.AllowVerticalSplit = ((bool)(resources.GetObject("dgrdData.AllowVerticalSplit")));
            this.dgrdData.AlternatingRows = ((bool)(resources.GetObject("dgrdData.AlternatingRows")));
            this.dgrdData.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("dgrdData.Anchor")));
            this.dgrdData.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("dgrdData.BackgroundImage")));
            this.dgrdData.BorderStyle = ((System.Windows.Forms.BorderStyle)(resources.GetObject("dgrdData.BorderStyle")));
            this.dgrdData.Caption = resources.GetString("dgrdData.Caption");
            this.dgrdData.CaptionHeight = ((int)(resources.GetObject("dgrdData.CaptionHeight")));
            this.dgrdData.CellTipsDelay = ((int)(resources.GetObject("dgrdData.CellTipsDelay")));
            this.dgrdData.CellTipsWidth = ((int)(resources.GetObject("dgrdData.CellTipsWidth")));
            this.dgrdData.ChildGrid = ((C1.Win.C1TrueDBGrid.C1TrueDBGrid)(resources.GetObject("dgrdData.ChildGrid")));
            this.dgrdData.CollapseColor = ((System.Drawing.Color)(resources.GetObject("dgrdData.CollapseColor")));
            this.dgrdData.ColumnFooters = ((bool)(resources.GetObject("dgrdData.ColumnFooters")));
            this.dgrdData.ColumnHeaders = ((bool)(resources.GetObject("dgrdData.ColumnHeaders")));
            this.dgrdData.DefColWidth = ((int)(resources.GetObject("dgrdData.DefColWidth")));
            this.dgrdData.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("dgrdData.Dock")));
            this.dgrdData.EditDropDown = ((bool)(resources.GetObject("dgrdData.EditDropDown")));
            this.dgrdData.EmptyRows = ((bool)(resources.GetObject("dgrdData.EmptyRows")));
            this.dgrdData.Enabled = ((bool)(resources.GetObject("dgrdData.Enabled")));
            this.dgrdData.ExpandColor = ((System.Drawing.Color)(resources.GetObject("dgrdData.ExpandColor")));
            this.dgrdData.ExposeCellMode = ((C1.Win.C1TrueDBGrid.ExposeCellModeEnum)(resources.GetObject("dgrdData.ExposeCellMode")));
            this.dgrdData.ExtendRightColumn = ((bool)(resources.GetObject("dgrdData.ExtendRightColumn")));
            this.dgrdData.FetchRowStyles = ((bool)(resources.GetObject("dgrdData.FetchRowStyles")));
            this.dgrdData.FilterBar = ((bool)(resources.GetObject("dgrdData.FilterBar")));
            this.dgrdData.FlatStyle = ((C1.Win.C1TrueDBGrid.FlatModeEnum)(resources.GetObject("dgrdData.FlatStyle")));
            this.dgrdData.Font = ((System.Drawing.Font)(resources.GetObject("dgrdData.Font")));
            this.dgrdData.GroupByAreaVisible = ((bool)(resources.GetObject("dgrdData.GroupByAreaVisible")));
            this.dgrdData.GroupByCaption = resources.GetString("dgrdData.GroupByCaption");
            this.dgrdData.Images.Add(((System.Drawing.Image)(resources.GetObject("resource"))));
            this.dgrdData.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("dgrdData.ImeMode")));
            this.dgrdData.LinesPerRow = ((int)(resources.GetObject("dgrdData.LinesPerRow")));
            this.dgrdData.Location = ((System.Drawing.Point)(resources.GetObject("dgrdData.Location")));
            this.dgrdData.MarqueeStyle = C1.Win.C1TrueDBGrid.MarqueeEnum.DottedCellBorder;
            this.dgrdData.Name = "dgrdData";
            this.dgrdData.PictureAddnewRow = ((System.Drawing.Image)(resources.GetObject("dgrdData.PictureAddnewRow")));
            this.dgrdData.PictureCurrentRow = ((System.Drawing.Image)(resources.GetObject("dgrdData.PictureCurrentRow")));
            this.dgrdData.PictureFilterBar = ((System.Drawing.Image)(resources.GetObject("dgrdData.PictureFilterBar")));
            this.dgrdData.PictureFooterRow = ((System.Drawing.Image)(resources.GetObject("dgrdData.PictureFooterRow")));
            this.dgrdData.PictureHeaderRow = ((System.Drawing.Image)(resources.GetObject("dgrdData.PictureHeaderRow")));
            this.dgrdData.PictureModifiedRow = ((System.Drawing.Image)(resources.GetObject("dgrdData.PictureModifiedRow")));
            this.dgrdData.PictureStandardRow = ((System.Drawing.Image)(resources.GetObject("dgrdData.PictureStandardRow")));
            this.dgrdData.PreviewInfo.AllowSizing = ((bool)(resources.GetObject("dgrdData.PreviewInfo.AllowSizing")));
            this.dgrdData.PreviewInfo.Caption = resources.GetString("dgrdData.PreviewInfo.Caption");
            this.dgrdData.PreviewInfo.Location = ((System.Drawing.Point)(resources.GetObject("dgrdData.PreviewInfo.Location")));
            this.dgrdData.PreviewInfo.Size = ((System.Drawing.Size)(resources.GetObject("dgrdData.PreviewInfo.Size")));
            this.dgrdData.PreviewInfo.ToolBars = ((bool)(resources.GetObject("dgrdData.PreviewInfo.ToolBars")));
            this.dgrdData.PreviewInfo.UIStrings.Content = ((string[])(resources.GetObject("dgrdData.PreviewInfo.UIStrings.Content")));
            this.dgrdData.PreviewInfo.ZoomFactor = ((System.Double)(resources.GetObject("dgrdData.PreviewInfo.ZoomFactor")));
            this.dgrdData.PrintInfo.MaxRowHeight = ((int)(resources.GetObject("dgrdData.PrintInfo.MaxRowHeight")));
            this.dgrdData.PrintInfo.OwnerDrawPageFooter = ((bool)(resources.GetObject("dgrdData.PrintInfo.OwnerDrawPageFooter")));
            this.dgrdData.PrintInfo.OwnerDrawPageHeader = ((bool)(resources.GetObject("dgrdData.PrintInfo.OwnerDrawPageHeader")));
            this.dgrdData.PrintInfo.PageFooter = resources.GetString("dgrdData.PrintInfo.PageFooter");
            this.dgrdData.PrintInfo.PageFooterHeight = ((int)(resources.GetObject("dgrdData.PrintInfo.PageFooterHeight")));
            this.dgrdData.PrintInfo.PageHeader = resources.GetString("dgrdData.PrintInfo.PageHeader");
            this.dgrdData.PrintInfo.PageHeaderHeight = ((int)(resources.GetObject("dgrdData.PrintInfo.PageHeaderHeight")));
            this.dgrdData.PrintInfo.PrintHorizontalSplits = ((bool)(resources.GetObject("dgrdData.PrintInfo.PrintHorizontalSplits")));
            this.dgrdData.PrintInfo.ProgressCaption = resources.GetString("dgrdData.PrintInfo.ProgressCaption");
            this.dgrdData.PrintInfo.RepeatColumnFooters = ((bool)(resources.GetObject("dgrdData.PrintInfo.RepeatColumnFooters")));
            this.dgrdData.PrintInfo.RepeatColumnHeaders = ((bool)(resources.GetObject("dgrdData.PrintInfo.RepeatColumnHeaders")));
            this.dgrdData.PrintInfo.RepeatGridHeader = ((bool)(resources.GetObject("dgrdData.PrintInfo.RepeatGridHeader")));
            this.dgrdData.PrintInfo.RepeatSplitHeaders = ((bool)(resources.GetObject("dgrdData.PrintInfo.RepeatSplitHeaders")));
            this.dgrdData.PrintInfo.ShowOptionsDialog = ((bool)(resources.GetObject("dgrdData.PrintInfo.ShowOptionsDialog")));
            this.dgrdData.PrintInfo.ShowProgressForm = ((bool)(resources.GetObject("dgrdData.PrintInfo.ShowProgressForm")));
            this.dgrdData.PrintInfo.ShowSelection = ((bool)(resources.GetObject("dgrdData.PrintInfo.ShowSelection")));
            this.dgrdData.PrintInfo.UseGridColors = ((bool)(resources.GetObject("dgrdData.PrintInfo.UseGridColors")));
            this.dgrdData.RecordSelectors = ((bool)(resources.GetObject("dgrdData.RecordSelectors")));
            this.dgrdData.RecordSelectorWidth = ((int)(resources.GetObject("dgrdData.RecordSelectorWidth")));
            this.dgrdData.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("dgrdData.RightToLeft")));
            this.dgrdData.RowDivider.Color = ((System.Drawing.Color)(resources.GetObject("resource.Color")));
            this.dgrdData.RowDivider.Style = ((C1.Win.C1TrueDBGrid.LineStyleEnum)(resources.GetObject("resource.Style")));
            this.dgrdData.RowHeight = ((int)(resources.GetObject("dgrdData.RowHeight")));
            this.dgrdData.RowSubDividerColor = ((System.Drawing.Color)(resources.GetObject("dgrdData.RowSubDividerColor")));
            this.dgrdData.ScrollTips = ((bool)(resources.GetObject("dgrdData.ScrollTips")));
            this.dgrdData.ScrollTrack = ((bool)(resources.GetObject("dgrdData.ScrollTrack")));
            this.dgrdData.Size = ((System.Drawing.Size)(resources.GetObject("dgrdData.Size")));
            this.dgrdData.SpringMode = ((bool)(resources.GetObject("dgrdData.SpringMode")));
            this.dgrdData.TabAcrossSplits = ((bool)(resources.GetObject("dgrdData.TabAcrossSplits")));
            this.dgrdData.TabIndex = ((int)(resources.GetObject("dgrdData.TabIndex")));
            this.dgrdData.Text = resources.GetString("dgrdData.Text");
            this.dgrdData.ViewCaptionWidth = ((int)(resources.GetObject("dgrdData.ViewCaptionWidth")));
            this.dgrdData.ViewColumnWidth = ((int)(resources.GetObject("dgrdData.ViewColumnWidth")));
            this.dgrdData.Visible = ((bool)(resources.GetObject("dgrdData.Visible")));
            this.dgrdData.WrapCellPointer = ((bool)(resources.GetObject("dgrdData.WrapCellPointer")));
            this.dgrdData.ButtonClick += new C1.Win.C1TrueDBGrid.ColEventHandler(this.dgrdData_ButtonClick);
            this.dgrdData.AfterColUpdate += new C1.Win.C1TrueDBGrid.ColEventHandler(this.dgrdData_AfterColUpdate);
            this.dgrdData.BeforeColUpdate += new C1.Win.C1TrueDBGrid.BeforeColUpdateEventHandler(this.dgrdData_BeforeColUpdate);
            this.dgrdData.Leave += new System.EventHandler(this.dgrdData_Leave);
            this.dgrdData.KeyDown += new System.Windows.Forms.KeyEventHandler(this.dgrdData_KeyDown);
            this.dgrdData.PropBag = resources.GetString("dgrdData.PropBag");
            // 
            // cboCCN
            // 
            this.cboCCN.AccessibleDescription = resources.GetString("cboCCN.AccessibleDescription");
            this.cboCCN.AccessibleName = resources.GetString("cboCCN.AccessibleName");
            this.cboCCN.AddItemSeparator = ';';
            this.cboCCN.AllowRowSizing = C1.Win.C1List.RowSizingEnum.AllRows;
            this.cboCCN.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("cboCCN.Anchor")));
            this.cboCCN.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("cboCCN.BackgroundImage")));
            this.cboCCN.Caption = "";
            this.cboCCN.CaptionHeight = 17;
            this.cboCCN.CharacterCasing = System.Windows.Forms.CharacterCasing.Normal;
            this.cboCCN.ColumnCaptionHeight = 17;
            this.cboCCN.ColumnFooterHeight = 17;
            this.cboCCN.ComboStyle = C1.Win.C1List.ComboStyleEnum.DropdownList;
            this.cboCCN.ContentHeight = 15;
            this.cboCCN.DeadAreaBackColor = System.Drawing.Color.Empty;
            this.cboCCN.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("cboCCN.Dock")));
            this.cboCCN.EditorBackColor = System.Drawing.SystemColors.Window;
            this.cboCCN.EditorFont = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
            this.cboCCN.EditorForeColor = System.Drawing.SystemColors.WindowText;
            this.cboCCN.EditorHeight = 15;
            this.cboCCN.Enabled = ((bool)(resources.GetObject("cboCCN.Enabled")));
            this.cboCCN.FlatStyle = C1.Win.C1List.FlatModeEnum.System;
            this.cboCCN.Font = ((System.Drawing.Font)(resources.GetObject("cboCCN.Font")));
            this.cboCCN.GapHeight = 2;
            this.cboCCN.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("cboCCN.ImeMode")));
            this.cboCCN.ItemHeight = 15;
            this.cboCCN.Location = ((System.Drawing.Point)(resources.GetObject("cboCCN.Location")));
            this.cboCCN.MatchEntryTimeout = ((long)(2000));
            this.cboCCN.MaxDropDownItems = ((short)(5));
            this.cboCCN.MaxLength = 32767;
            this.cboCCN.MouseCursor = System.Windows.Forms.Cursors.Default;
            this.cboCCN.Name = "cboCCN";
            this.cboCCN.PartialRightColumn = false;
            this.cboCCN.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("cboCCN.RightToLeft")));
            this.cboCCN.RowDivider.Color = System.Drawing.Color.DarkGray;
            this.cboCCN.RowDivider.Style = C1.Win.C1List.LineStyleEnum.None;
            this.cboCCN.RowSubDividerColor = System.Drawing.Color.DarkGray;
            this.cboCCN.Size = ((System.Drawing.Size)(resources.GetObject("cboCCN.Size")));
            this.cboCCN.TabIndex = ((int)(resources.GetObject("cboCCN.TabIndex")));
            this.cboCCN.Text = resources.GetString("cboCCN.Text");
            this.cboCCN.Visible = ((bool)(resources.GetObject("cboCCN.Visible")));
            this.cboCCN.TextChanged += new System.EventHandler(this.cboCCN_TextChanged);
            this.cboCCN.PropBag = "<?xml version=\"1.0\"?><Blob><Styles type=\"C1.Win.C1List.Design.ContextWrapper\"><Da" +
                "ta>Group{AlignVert:Center;Border:None,,0, 0, 0, 0;BackColor:ControlDark;}Style2{" +
                "}Style5{}Style4{}Style7{}Style6{}EvenRow{BackColor:Aqua;}Selected{ForeColor:High" +
                "lightText;BackColor:Highlight;}Style3{}Inactive{ForeColor:InactiveCaptionText;Ba" +
                "ckColor:InactiveCaption;}Footer{}Caption{AlignHorz:Center;}Normal{BackColor:Wind" +
                "ow;}HighlightRow{ForeColor:HighlightText;BackColor:Highlight;}Style1{}OddRow{}Re" +
                "cordSelector{AlignImage:Center;}Heading{Wrap:True;BackColor:Control;Border:Raise" +
                "d,,1, 1, 1, 1;ForeColor:ControlText;AlignVert:Center;}Style8{}Style10{}Style11{}" +
                "Style9{AlignHorz:Near;}</Data></Styles><Splits><C1.Win.C1List.ListBoxView AllowC" +
                "olSelect=\"False\" Name=\"\" CaptionHeight=\"17\" ColumnCaptionHeight=\"17\" ColumnFoote" +
                "rHeight=\"17\" VerticalScrollGroup=\"1\" HorizontalScrollGroup=\"1\"><ClientRect>0, 0," +
                " 116, 156</ClientRect><VScrollBar><Width>16</Width></VScrollBar><HScrollBar><Hei" +
                "ght>16</Height></HScrollBar><CaptionStyle parent=\"Style2\" me=\"Style9\" /><EvenRow" +
                "Style parent=\"EvenRow\" me=\"Style7\" /><FooterStyle parent=\"Footer\" me=\"Style3\" />" +
                "<GroupStyle parent=\"Group\" me=\"Style11\" /><HeadingStyle parent=\"Heading\" me=\"Sty" +
                "le2\" /><HighLightRowStyle parent=\"HighlightRow\" me=\"Style6\" /><InactiveStyle par" +
                "ent=\"Inactive\" me=\"Style4\" /><OddRowStyle parent=\"OddRow\" me=\"Style8\" /><RecordS" +
                "electorStyle parent=\"RecordSelector\" me=\"Style10\" /><SelectedStyle parent=\"Selec" +
                "ted\" me=\"Style5\" /><Style parent=\"Normal\" me=\"Style1\" /></C1.Win.C1List.ListBoxV" +
                "iew></Splits><NamedStyles><Style parent=\"\" me=\"Normal\" /><Style parent=\"Normal\" " +
                "me=\"Heading\" /><Style parent=\"Heading\" me=\"Footer\" /><Style parent=\"Heading\" me=" +
                "\"Caption\" /><Style parent=\"Heading\" me=\"Inactive\" /><Style parent=\"Normal\" me=\"S" +
                "elected\" /><Style parent=\"Normal\" me=\"HighlightRow\" /><Style parent=\"Normal\" me=" +
                "\"EvenRow\" /><Style parent=\"Normal\" me=\"OddRow\" /><Style parent=\"Heading\" me=\"Rec" +
                "ordSelector\" /><Style parent=\"Caption\" me=\"Group\" /></NamedStyles><vertSplits>1<" +
                "/vertSplits><horzSplits>1</horzSplits><Layout>Modified</Layout><DefaultRecSelWid" +
                "th>16</DefaultRecSelWidth></Blob>";
            // 
            // lblCCN
            // 
            this.lblCCN.AccessibleDescription = resources.GetString("lblCCN.AccessibleDescription");
            this.lblCCN.AccessibleName = resources.GetString("lblCCN.AccessibleName");
            this.lblCCN.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("lblCCN.Anchor")));
            this.lblCCN.AutoSize = ((bool)(resources.GetObject("lblCCN.AutoSize")));
            this.lblCCN.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("lblCCN.Dock")));
            this.lblCCN.Enabled = ((bool)(resources.GetObject("lblCCN.Enabled")));
            this.lblCCN.Font = ((System.Drawing.Font)(resources.GetObject("lblCCN.Font")));
            this.lblCCN.ForeColor = System.Drawing.Color.Maroon;
            this.lblCCN.Image = ((System.Drawing.Image)(resources.GetObject("lblCCN.Image")));
            this.lblCCN.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblCCN.ImageAlign")));
            this.lblCCN.ImageIndex = ((int)(resources.GetObject("lblCCN.ImageIndex")));
            this.lblCCN.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("lblCCN.ImeMode")));
            this.lblCCN.Location = ((System.Drawing.Point)(resources.GetObject("lblCCN.Location")));
            this.lblCCN.Name = "lblCCN";
            this.lblCCN.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("lblCCN.RightToLeft")));
            this.lblCCN.Size = ((System.Drawing.Size)(resources.GetObject("lblCCN.Size")));
            this.lblCCN.TabIndex = ((int)(resources.GetObject("lblCCN.TabIndex")));
            this.lblCCN.Text = resources.GetString("lblCCN.Text");
            this.lblCCN.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblCCN.TextAlign")));
            this.lblCCN.Visible = ((bool)(resources.GetObject("lblCCN.Visible")));
            // 
            // btnFindItem
            // 
            this.btnFindItem.AccessibleDescription = resources.GetString("btnFindItem.AccessibleDescription");
            this.btnFindItem.AccessibleName = resources.GetString("btnFindItem.AccessibleName");
            this.btnFindItem.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("btnFindItem.Anchor")));
            this.btnFindItem.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnFindItem.BackgroundImage")));
            this.btnFindItem.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("btnFindItem.Dock")));
            this.btnFindItem.Enabled = ((bool)(resources.GetObject("btnFindItem.Enabled")));
            this.btnFindItem.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("btnFindItem.FlatStyle")));
            this.btnFindItem.Font = ((System.Drawing.Font)(resources.GetObject("btnFindItem.Font")));
            this.btnFindItem.Image = ((System.Drawing.Image)(resources.GetObject("btnFindItem.Image")));
            this.btnFindItem.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnFindItem.ImageAlign")));
            this.btnFindItem.ImageIndex = ((int)(resources.GetObject("btnFindItem.ImageIndex")));
            this.btnFindItem.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("btnFindItem.ImeMode")));
            this.btnFindItem.Location = ((System.Drawing.Point)(resources.GetObject("btnFindItem.Location")));
            this.btnFindItem.Name = "btnFindItem";
            this.btnFindItem.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("btnFindItem.RightToLeft")));
            this.btnFindItem.Size = ((System.Drawing.Size)(resources.GetObject("btnFindItem.Size")));
            this.btnFindItem.TabIndex = ((int)(resources.GetObject("btnFindItem.TabIndex")));
            this.btnFindItem.Text = resources.GetString("btnFindItem.Text");
            this.btnFindItem.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnFindItem.TextAlign")));
            this.btnFindItem.Visible = ((bool)(resources.GetObject("btnFindItem.Visible")));
            this.btnFindItem.Click += new System.EventHandler(this.btnFindItem_Click);
            // 
            // lblRevision
            // 
            this.lblRevision.AccessibleDescription = resources.GetString("lblRevision.AccessibleDescription");
            this.lblRevision.AccessibleName = resources.GetString("lblRevision.AccessibleName");
            this.lblRevision.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("lblRevision.Anchor")));
            this.lblRevision.AutoSize = ((bool)(resources.GetObject("lblRevision.AutoSize")));
            this.lblRevision.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("lblRevision.Dock")));
            this.lblRevision.Enabled = ((bool)(resources.GetObject("lblRevision.Enabled")));
            this.lblRevision.Font = ((System.Drawing.Font)(resources.GetObject("lblRevision.Font")));
            this.lblRevision.ForeColor = System.Drawing.Color.Maroon;
            this.lblRevision.Image = ((System.Drawing.Image)(resources.GetObject("lblRevision.Image")));
            this.lblRevision.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblRevision.ImageAlign")));
            this.lblRevision.ImageIndex = ((int)(resources.GetObject("lblRevision.ImageIndex")));
            this.lblRevision.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("lblRevision.ImeMode")));
            this.lblRevision.Location = ((System.Drawing.Point)(resources.GetObject("lblRevision.Location")));
            this.lblRevision.Name = "lblRevision";
            this.lblRevision.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("lblRevision.RightToLeft")));
            this.lblRevision.Size = ((System.Drawing.Size)(resources.GetObject("lblRevision.Size")));
            this.lblRevision.TabIndex = ((int)(resources.GetObject("lblRevision.TabIndex")));
            this.lblRevision.Text = resources.GetString("lblRevision.Text");
            this.lblRevision.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblRevision.TextAlign")));
            this.lblRevision.Visible = ((bool)(resources.GetObject("lblRevision.Visible")));
            // 
            // lblPartName
            // 
            this.lblPartName.AccessibleDescription = resources.GetString("lblPartName.AccessibleDescription");
            this.lblPartName.AccessibleName = resources.GetString("lblPartName.AccessibleName");
            this.lblPartName.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("lblPartName.Anchor")));
            this.lblPartName.AutoSize = ((bool)(resources.GetObject("lblPartName.AutoSize")));
            this.lblPartName.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("lblPartName.Dock")));
            this.lblPartName.Enabled = ((bool)(resources.GetObject("lblPartName.Enabled")));
            this.lblPartName.Font = ((System.Drawing.Font)(resources.GetObject("lblPartName.Font")));
            this.lblPartName.ForeColor = System.Drawing.Color.Maroon;
            this.lblPartName.Image = ((System.Drawing.Image)(resources.GetObject("lblPartName.Image")));
            this.lblPartName.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblPartName.ImageAlign")));
            this.lblPartName.ImageIndex = ((int)(resources.GetObject("lblPartName.ImageIndex")));
            this.lblPartName.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("lblPartName.ImeMode")));
            this.lblPartName.Location = ((System.Drawing.Point)(resources.GetObject("lblPartName.Location")));
            this.lblPartName.Name = "lblPartName";
            this.lblPartName.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("lblPartName.RightToLeft")));
            this.lblPartName.Size = ((System.Drawing.Size)(resources.GetObject("lblPartName.Size")));
            this.lblPartName.TabIndex = ((int)(resources.GetObject("lblPartName.TabIndex")));
            this.lblPartName.Text = resources.GetString("lblPartName.Text");
            this.lblPartName.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblPartName.TextAlign")));
            this.lblPartName.Visible = ((bool)(resources.GetObject("lblPartName.Visible")));
            // 
            // lblPartNumber
            // 
            this.lblPartNumber.AccessibleDescription = resources.GetString("lblPartNumber.AccessibleDescription");
            this.lblPartNumber.AccessibleName = resources.GetString("lblPartNumber.AccessibleName");
            this.lblPartNumber.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("lblPartNumber.Anchor")));
            this.lblPartNumber.AutoSize = ((bool)(resources.GetObject("lblPartNumber.AutoSize")));
            this.lblPartNumber.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("lblPartNumber.Dock")));
            this.lblPartNumber.Enabled = ((bool)(resources.GetObject("lblPartNumber.Enabled")));
            this.lblPartNumber.Font = ((System.Drawing.Font)(resources.GetObject("lblPartNumber.Font")));
            this.lblPartNumber.ForeColor = System.Drawing.Color.Maroon;
            this.lblPartNumber.Image = ((System.Drawing.Image)(resources.GetObject("lblPartNumber.Image")));
            this.lblPartNumber.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblPartNumber.ImageAlign")));
            this.lblPartNumber.ImageIndex = ((int)(resources.GetObject("lblPartNumber.ImageIndex")));
            this.lblPartNumber.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("lblPartNumber.ImeMode")));
            this.lblPartNumber.Location = ((System.Drawing.Point)(resources.GetObject("lblPartNumber.Location")));
            this.lblPartNumber.Name = "lblPartNumber";
            this.lblPartNumber.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("lblPartNumber.RightToLeft")));
            this.lblPartNumber.Size = ((System.Drawing.Size)(resources.GetObject("lblPartNumber.Size")));
            this.lblPartNumber.TabIndex = ((int)(resources.GetObject("lblPartNumber.TabIndex")));
            this.lblPartNumber.Text = resources.GetString("lblPartNumber.Text");
            this.lblPartNumber.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblPartNumber.TextAlign")));
            this.lblPartNumber.Visible = ((bool)(resources.GetObject("lblPartNumber.Visible")));
            // 
            // lblBomDes
            // 
            this.lblBomDes.AccessibleDescription = resources.GetString("lblBomDes.AccessibleDescription");
            this.lblBomDes.AccessibleName = resources.GetString("lblBomDes.AccessibleName");
            this.lblBomDes.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("lblBomDes.Anchor")));
            this.lblBomDes.AutoSize = ((bool)(resources.GetObject("lblBomDes.AutoSize")));
            this.lblBomDes.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("lblBomDes.Dock")));
            this.lblBomDes.Enabled = ((bool)(resources.GetObject("lblBomDes.Enabled")));
            this.lblBomDes.Font = ((System.Drawing.Font)(resources.GetObject("lblBomDes.Font")));
            this.lblBomDes.Image = ((System.Drawing.Image)(resources.GetObject("lblBomDes.Image")));
            this.lblBomDes.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblBomDes.ImageAlign")));
            this.lblBomDes.ImageIndex = ((int)(resources.GetObject("lblBomDes.ImageIndex")));
            this.lblBomDes.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("lblBomDes.ImeMode")));
            this.lblBomDes.Location = ((System.Drawing.Point)(resources.GetObject("lblBomDes.Location")));
            this.lblBomDes.Name = "lblBomDes";
            this.lblBomDes.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("lblBomDes.RightToLeft")));
            this.lblBomDes.Size = ((System.Drawing.Size)(resources.GetObject("lblBomDes.Size")));
            this.lblBomDes.TabIndex = ((int)(resources.GetObject("lblBomDes.TabIndex")));
            this.lblBomDes.Text = resources.GetString("lblBomDes.Text");
            this.lblBomDes.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblBomDes.TextAlign")));
            this.lblBomDes.Visible = ((bool)(resources.GetObject("lblBomDes.Visible")));
            // 
            // lblIncre
            // 
            this.lblIncre.AccessibleDescription = resources.GetString("lblIncre.AccessibleDescription");
            this.lblIncre.AccessibleName = resources.GetString("lblIncre.AccessibleName");
            this.lblIncre.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("lblIncre.Anchor")));
            this.lblIncre.AutoSize = ((bool)(resources.GetObject("lblIncre.AutoSize")));
            this.lblIncre.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("lblIncre.Dock")));
            this.lblIncre.Enabled = ((bool)(resources.GetObject("lblIncre.Enabled")));
            this.lblIncre.Font = ((System.Drawing.Font)(resources.GetObject("lblIncre.Font")));
            this.lblIncre.Image = ((System.Drawing.Image)(resources.GetObject("lblIncre.Image")));
            this.lblIncre.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblIncre.ImageAlign")));
            this.lblIncre.ImageIndex = ((int)(resources.GetObject("lblIncre.ImageIndex")));
            this.lblIncre.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("lblIncre.ImeMode")));
            this.lblIncre.Location = ((System.Drawing.Point)(resources.GetObject("lblIncre.Location")));
            this.lblIncre.Name = "lblIncre";
            this.lblIncre.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("lblIncre.RightToLeft")));
            this.lblIncre.Size = ((System.Drawing.Size)(resources.GetObject("lblIncre.Size")));
            this.lblIncre.TabIndex = ((int)(resources.GetObject("lblIncre.TabIndex")));
            this.lblIncre.Text = resources.GetString("lblIncre.Text");
            this.lblIncre.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblIncre.TextAlign")));
            this.lblIncre.Visible = ((bool)(resources.GetObject("lblIncre.Visible")));
            // 
            // chkMakeItem
            // 
            this.chkMakeItem.AccessibleDescription = resources.GetString("chkMakeItem.AccessibleDescription");
            this.chkMakeItem.AccessibleName = resources.GetString("chkMakeItem.AccessibleName");
            this.chkMakeItem.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("chkMakeItem.Anchor")));
            this.chkMakeItem.Appearance = ((System.Windows.Forms.Appearance)(resources.GetObject("chkMakeItem.Appearance")));
            this.chkMakeItem.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("chkMakeItem.BackgroundImage")));
            this.chkMakeItem.CheckAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("chkMakeItem.CheckAlign")));
            this.chkMakeItem.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("chkMakeItem.Dock")));
            this.chkMakeItem.Enabled = ((bool)(resources.GetObject("chkMakeItem.Enabled")));
            this.chkMakeItem.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("chkMakeItem.FlatStyle")));
            this.chkMakeItem.Font = ((System.Drawing.Font)(resources.GetObject("chkMakeItem.Font")));
            this.chkMakeItem.Image = ((System.Drawing.Image)(resources.GetObject("chkMakeItem.Image")));
            this.chkMakeItem.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("chkMakeItem.ImageAlign")));
            this.chkMakeItem.ImageIndex = ((int)(resources.GetObject("chkMakeItem.ImageIndex")));
            this.chkMakeItem.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("chkMakeItem.ImeMode")));
            this.chkMakeItem.Location = ((System.Drawing.Point)(resources.GetObject("chkMakeItem.Location")));
            this.chkMakeItem.Name = "chkMakeItem";
            this.chkMakeItem.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("chkMakeItem.RightToLeft")));
            this.chkMakeItem.Size = ((System.Drawing.Size)(resources.GetObject("chkMakeItem.Size")));
            this.chkMakeItem.TabIndex = ((int)(resources.GetObject("chkMakeItem.TabIndex")));
            this.chkMakeItem.Text = resources.GetString("chkMakeItem.Text");
            this.chkMakeItem.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("chkMakeItem.TextAlign")));
            this.chkMakeItem.Visible = ((bool)(resources.GetObject("chkMakeItem.Visible")));
            // 
            // txtItemCode
            // 
            this.txtItemCode.AccessibleDescription = resources.GetString("txtItemCode.AccessibleDescription");
            this.txtItemCode.AccessibleName = resources.GetString("txtItemCode.AccessibleName");
            this.txtItemCode.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("txtItemCode.Anchor")));
            this.txtItemCode.AutoSize = ((bool)(resources.GetObject("txtItemCode.AutoSize")));
            this.txtItemCode.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("txtItemCode.BackgroundImage")));
            this.txtItemCode.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("txtItemCode.Dock")));
            this.txtItemCode.Enabled = ((bool)(resources.GetObject("txtItemCode.Enabled")));
            this.txtItemCode.Font = ((System.Drawing.Font)(resources.GetObject("txtItemCode.Font")));
            this.txtItemCode.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("txtItemCode.ImeMode")));
            this.txtItemCode.Location = ((System.Drawing.Point)(resources.GetObject("txtItemCode.Location")));
            this.txtItemCode.MaxLength = ((int)(resources.GetObject("txtItemCode.MaxLength")));
            this.txtItemCode.Multiline = ((bool)(resources.GetObject("txtItemCode.Multiline")));
            this.txtItemCode.Name = "txtItemCode";
            this.txtItemCode.PasswordChar = ((char)(resources.GetObject("txtItemCode.PasswordChar")));
            this.txtItemCode.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("txtItemCode.RightToLeft")));
            this.txtItemCode.ScrollBars = ((System.Windows.Forms.ScrollBars)(resources.GetObject("txtItemCode.ScrollBars")));
            this.txtItemCode.Size = ((System.Drawing.Size)(resources.GetObject("txtItemCode.Size")));
            this.txtItemCode.TabIndex = ((int)(resources.GetObject("txtItemCode.TabIndex")));
            this.txtItemCode.Text = resources.GetString("txtItemCode.Text");
            this.txtItemCode.TextAlign = ((System.Windows.Forms.HorizontalAlignment)(resources.GetObject("txtItemCode.TextAlign")));
            this.txtItemCode.Visible = ((bool)(resources.GetObject("txtItemCode.Visible")));
            this.txtItemCode.WordWrap = ((bool)(resources.GetObject("txtItemCode.WordWrap")));
            this.txtItemCode.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtItemCode_KeyDown);
            this.txtItemCode.Validating += new System.ComponentModel.CancelEventHandler(this.txtItemCode_Validating);
            // 
            // txtBOMDes
            // 
            this.txtBOMDes.AccessibleDescription = resources.GetString("txtBOMDes.AccessibleDescription");
            this.txtBOMDes.AccessibleName = resources.GetString("txtBOMDes.AccessibleName");
            this.txtBOMDes.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("txtBOMDes.Anchor")));
            this.txtBOMDes.AutoSize = ((bool)(resources.GetObject("txtBOMDes.AutoSize")));
            this.txtBOMDes.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("txtBOMDes.BackgroundImage")));
            this.txtBOMDes.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("txtBOMDes.Dock")));
            this.txtBOMDes.Enabled = ((bool)(resources.GetObject("txtBOMDes.Enabled")));
            this.txtBOMDes.Font = ((System.Drawing.Font)(resources.GetObject("txtBOMDes.Font")));
            this.txtBOMDes.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("txtBOMDes.ImeMode")));
            this.txtBOMDes.Location = ((System.Drawing.Point)(resources.GetObject("txtBOMDes.Location")));
            this.txtBOMDes.MaxLength = ((int)(resources.GetObject("txtBOMDes.MaxLength")));
            this.txtBOMDes.Multiline = ((bool)(resources.GetObject("txtBOMDes.Multiline")));
            this.txtBOMDes.Name = "txtBOMDes";
            this.txtBOMDes.PasswordChar = ((char)(resources.GetObject("txtBOMDes.PasswordChar")));
            this.txtBOMDes.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("txtBOMDes.RightToLeft")));
            this.txtBOMDes.ScrollBars = ((System.Windows.Forms.ScrollBars)(resources.GetObject("txtBOMDes.ScrollBars")));
            this.txtBOMDes.Size = ((System.Drawing.Size)(resources.GetObject("txtBOMDes.Size")));
            this.txtBOMDes.TabIndex = ((int)(resources.GetObject("txtBOMDes.TabIndex")));
            this.txtBOMDes.Text = resources.GetString("txtBOMDes.Text");
            this.txtBOMDes.TextAlign = ((System.Windows.Forms.HorizontalAlignment)(resources.GetObject("txtBOMDes.TextAlign")));
            this.txtBOMDes.Visible = ((bool)(resources.GetObject("txtBOMDes.Visible")));
            this.txtBOMDes.WordWrap = ((bool)(resources.GetObject("txtBOMDes.WordWrap")));
            // 
            // dtmEffectiveDate
            // 
            this.dtmEffectiveDate.AcceptsEscape = ((bool)(resources.GetObject("dtmEffectiveDate.AcceptsEscape")));
            this.dtmEffectiveDate.AccessibleDescription = resources.GetString("dtmEffectiveDate.AccessibleDescription");
            this.dtmEffectiveDate.AccessibleName = resources.GetString("dtmEffectiveDate.AccessibleName");
            this.dtmEffectiveDate.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("dtmEffectiveDate.Anchor")));
            this.dtmEffectiveDate.AutoSize = ((bool)(resources.GetObject("dtmEffectiveDate.AutoSize")));
            this.dtmEffectiveDate.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("dtmEffectiveDate.BackgroundImage")));
            this.dtmEffectiveDate.BorderStyle = ((System.Windows.Forms.BorderStyle)(resources.GetObject("dtmEffectiveDate.BorderStyle")));
            // 
            // dtmEffectiveDate.Calendar
            // 
            this.dtmEffectiveDate.Calendar.AccessibleDescription = resources.GetString("dtmEffectiveDate.Calendar.AccessibleDescription");
            this.dtmEffectiveDate.Calendar.AccessibleName = resources.GetString("dtmEffectiveDate.Calendar.AccessibleName");
            this.dtmEffectiveDate.Calendar.AnnuallyBoldedDates = ((System.DateTime[])(resources.GetObject("dtmEffectiveDate.Calendar.AnnuallyBoldedDates")));
            this.dtmEffectiveDate.Calendar.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("dtmEffectiveDate.Calendar.BackgroundImage")));
            this.dtmEffectiveDate.Calendar.BoldedDates = ((System.DateTime[])(resources.GetObject("dtmEffectiveDate.Calendar.BoldedDates")));
            this.dtmEffectiveDate.Calendar.CalendarDimensions = ((System.Drawing.Size)(resources.GetObject("dtmEffectiveDate.Calendar.CalendarDimensions")));
            this.dtmEffectiveDate.Calendar.Enabled = ((bool)(resources.GetObject("dtmEffectiveDate.Calendar.Enabled")));
            this.dtmEffectiveDate.Calendar.FirstDayOfWeek = ((System.Windows.Forms.Day)(resources.GetObject("dtmEffectiveDate.Calendar.FirstDayOfWeek")));
            this.dtmEffectiveDate.Calendar.Font = ((System.Drawing.Font)(resources.GetObject("dtmEffectiveDate.Calendar.Font")));
            this.dtmEffectiveDate.Calendar.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("dtmEffectiveDate.Calendar.ImeMode")));
            this.dtmEffectiveDate.Calendar.MonthlyBoldedDates = ((System.DateTime[])(resources.GetObject("dtmEffectiveDate.Calendar.MonthlyBoldedDates")));
            this.dtmEffectiveDate.Calendar.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("dtmEffectiveDate.Calendar.RightToLeft")));
            this.dtmEffectiveDate.Calendar.ShowClearButton = ((bool)(resources.GetObject("dtmEffectiveDate.Calendar.ShowClearButton")));
            this.dtmEffectiveDate.Calendar.ShowTodayButton = ((bool)(resources.GetObject("dtmEffectiveDate.Calendar.ShowTodayButton")));
            this.dtmEffectiveDate.Calendar.ShowWeekNumbers = ((bool)(resources.GetObject("dtmEffectiveDate.Calendar.ShowWeekNumbers")));
            this.dtmEffectiveDate.CaseSensitive = ((bool)(resources.GetObject("dtmEffectiveDate.CaseSensitive")));
            this.dtmEffectiveDate.Culture = ((int)(resources.GetObject("dtmEffectiveDate.Culture")));
            this.dtmEffectiveDate.CurrentTimeZone = ((bool)(resources.GetObject("dtmEffectiveDate.CurrentTimeZone")));
            this.dtmEffectiveDate.CustomFormat = resources.GetString("dtmEffectiveDate.CustomFormat");
            this.dtmEffectiveDate.DaylightTimeAdjustment = ((C1.Win.C1Input.DaylightTimeAdjustmentEnum)(resources.GetObject("dtmEffectiveDate.DaylightTimeAdjustment")));
            this.dtmEffectiveDate.DisplayFormat.CustomFormat = resources.GetString("dtmEffectiveDate.DisplayFormat.CustomFormat");
            this.dtmEffectiveDate.DisplayFormat.FormatType = ((C1.Win.C1Input.FormatTypeEnum)(resources.GetObject("dtmEffectiveDate.DisplayFormat.FormatType")));
            this.dtmEffectiveDate.DisplayFormat.Inherit = ((C1.Win.C1Input.FormatInfoInheritFlags)(resources.GetObject("dtmEffectiveDate.DisplayFormat.Inherit")));
            this.dtmEffectiveDate.DisplayFormat.NullText = resources.GetString("dtmEffectiveDate.DisplayFormat.NullText");
            this.dtmEffectiveDate.DisplayFormat.TrimEnd = ((bool)(resources.GetObject("dtmEffectiveDate.DisplayFormat.TrimEnd")));
            this.dtmEffectiveDate.DisplayFormat.TrimStart = ((bool)(resources.GetObject("dtmEffectiveDate.DisplayFormat.TrimStart")));
            this.dtmEffectiveDate.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("dtmEffectiveDate.Dock")));
            this.dtmEffectiveDate.DropDownFormAlign = ((C1.Win.C1Input.DropDownFormAlignmentEnum)(resources.GetObject("dtmEffectiveDate.DropDownFormAlign")));
            this.dtmEffectiveDate.EditFormat.CustomFormat = resources.GetString("dtmEffectiveDate.EditFormat.CustomFormat");
            this.dtmEffectiveDate.EditFormat.FormatType = ((C1.Win.C1Input.FormatTypeEnum)(resources.GetObject("dtmEffectiveDate.EditFormat.FormatType")));
            this.dtmEffectiveDate.EditFormat.Inherit = ((C1.Win.C1Input.FormatInfoInheritFlags)(resources.GetObject("dtmEffectiveDate.EditFormat.Inherit")));
            this.dtmEffectiveDate.EditFormat.NullText = resources.GetString("dtmEffectiveDate.EditFormat.NullText");
            this.dtmEffectiveDate.EditFormat.TrimEnd = ((bool)(resources.GetObject("dtmEffectiveDate.EditFormat.TrimEnd")));
            this.dtmEffectiveDate.EditFormat.TrimStart = ((bool)(resources.GetObject("dtmEffectiveDate.EditFormat.TrimStart")));
            this.dtmEffectiveDate.EditMask = resources.GetString("dtmEffectiveDate.EditMask");
            this.dtmEffectiveDate.EmptyAsNull = ((bool)(resources.GetObject("dtmEffectiveDate.EmptyAsNull")));
            this.dtmEffectiveDate.Enabled = ((bool)(resources.GetObject("dtmEffectiveDate.Enabled")));
            this.dtmEffectiveDate.ErrorInfo.BeepOnError = ((bool)(resources.GetObject("dtmEffectiveDate.ErrorInfo.BeepOnError")));
            this.dtmEffectiveDate.ErrorInfo.ErrorMessage = resources.GetString("dtmEffectiveDate.ErrorInfo.ErrorMessage");
            this.dtmEffectiveDate.ErrorInfo.ErrorMessageCaption = resources.GetString("dtmEffectiveDate.ErrorInfo.ErrorMessageCaption");
            this.dtmEffectiveDate.ErrorInfo.ShowErrorMessage = ((bool)(resources.GetObject("dtmEffectiveDate.ErrorInfo.ShowErrorMessage")));
            this.dtmEffectiveDate.ErrorInfo.ValueOnError = ((object)(resources.GetObject("dtmEffectiveDate.ErrorInfo.ValueOnError")));
            this.dtmEffectiveDate.Font = ((System.Drawing.Font)(resources.GetObject("dtmEffectiveDate.Font")));
            this.dtmEffectiveDate.FormatType = ((C1.Win.C1Input.FormatTypeEnum)(resources.GetObject("dtmEffectiveDate.FormatType")));
            this.dtmEffectiveDate.GapHeight = ((int)(resources.GetObject("dtmEffectiveDate.GapHeight")));
            this.dtmEffectiveDate.GMTOffset = ((System.TimeSpan)(resources.GetObject("dtmEffectiveDate.GMTOffset")));
            this.dtmEffectiveDate.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("dtmEffectiveDate.ImeMode")));
            this.dtmEffectiveDate.InitialSelection = ((C1.Win.C1Input.InitialSelectionEnum)(resources.GetObject("dtmEffectiveDate.InitialSelection")));
            this.dtmEffectiveDate.Location = ((System.Drawing.Point)(resources.GetObject("dtmEffectiveDate.Location")));
            this.dtmEffectiveDate.MaskInfo.AutoTabWhenFilled = ((bool)(resources.GetObject("dtmEffectiveDate.MaskInfo.AutoTabWhenFilled")));
            this.dtmEffectiveDate.MaskInfo.CaseSensitive = ((bool)(resources.GetObject("dtmEffectiveDate.MaskInfo.CaseSensitive")));
            this.dtmEffectiveDate.MaskInfo.CopyWithLiterals = ((bool)(resources.GetObject("dtmEffectiveDate.MaskInfo.CopyWithLiterals")));
            this.dtmEffectiveDate.MaskInfo.EditMask = resources.GetString("dtmEffectiveDate.MaskInfo.EditMask");
            this.dtmEffectiveDate.MaskInfo.EmptyAsNull = ((bool)(resources.GetObject("dtmEffectiveDate.MaskInfo.EmptyAsNull")));
            this.dtmEffectiveDate.MaskInfo.ErrorMessage = resources.GetString("dtmEffectiveDate.MaskInfo.ErrorMessage");
            this.dtmEffectiveDate.MaskInfo.Inherit = ((C1.Win.C1Input.MaskInfoInheritFlags)(resources.GetObject("dtmEffectiveDate.MaskInfo.Inherit")));
            this.dtmEffectiveDate.MaskInfo.PromptChar = ((char)(resources.GetObject("dtmEffectiveDate.MaskInfo.PromptChar")));
            this.dtmEffectiveDate.MaskInfo.ShowLiterals = ((C1.Win.C1Input.ShowLiteralsEnum)(resources.GetObject("dtmEffectiveDate.MaskInfo.ShowLiterals")));
            this.dtmEffectiveDate.MaskInfo.StoredEmptyChar = ((char)(resources.GetObject("dtmEffectiveDate.MaskInfo.StoredEmptyChar")));
            this.dtmEffectiveDate.MaxLength = ((int)(resources.GetObject("dtmEffectiveDate.MaxLength")));
            this.dtmEffectiveDate.Name = "dtmEffectiveDate";
            this.dtmEffectiveDate.NullText = resources.GetString("dtmEffectiveDate.NullText");
            this.dtmEffectiveDate.ParseInfo.CaseSensitive = ((bool)(resources.GetObject("dtmEffectiveDate.ParseInfo.CaseSensitive")));
            this.dtmEffectiveDate.ParseInfo.CustomFormat = resources.GetString("dtmEffectiveDate.ParseInfo.CustomFormat");
            this.dtmEffectiveDate.ParseInfo.DateTimeStyle = ((C1.Win.C1Input.DateTimeStyleFlags)(resources.GetObject("dtmEffectiveDate.ParseInfo.DateTimeStyle")));
            this.dtmEffectiveDate.ParseInfo.EmptyAsNull = ((bool)(resources.GetObject("dtmEffectiveDate.ParseInfo.EmptyAsNull")));
            this.dtmEffectiveDate.ParseInfo.ErrorMessage = resources.GetString("dtmEffectiveDate.ParseInfo.ErrorMessage");
            this.dtmEffectiveDate.ParseInfo.FormatType = ((C1.Win.C1Input.FormatTypeEnum)(resources.GetObject("dtmEffectiveDate.ParseInfo.FormatType")));
            this.dtmEffectiveDate.ParseInfo.Inherit = ((C1.Win.C1Input.ParseInfoInheritFlags)(resources.GetObject("dtmEffectiveDate.ParseInfo.Inherit")));
            this.dtmEffectiveDate.ParseInfo.NullText = resources.GetString("dtmEffectiveDate.ParseInfo.NullText");
            this.dtmEffectiveDate.ParseInfo.TrimEnd = ((bool)(resources.GetObject("dtmEffectiveDate.ParseInfo.TrimEnd")));
            this.dtmEffectiveDate.ParseInfo.TrimStart = ((bool)(resources.GetObject("dtmEffectiveDate.ParseInfo.TrimStart")));
            this.dtmEffectiveDate.PasswordChar = ((char)(resources.GetObject("dtmEffectiveDate.PasswordChar")));
            this.dtmEffectiveDate.PostValidation.CaseSensitive = ((bool)(resources.GetObject("dtmEffectiveDate.PostValidation.CaseSensitive")));
            this.dtmEffectiveDate.PostValidation.ErrorMessage = resources.GetString("dtmEffectiveDate.PostValidation.ErrorMessage");
            this.dtmEffectiveDate.PostValidation.Inherit = ((C1.Win.C1Input.PostValidationInheritFlags)(resources.GetObject("dtmEffectiveDate.PostValidation.Inherit")));
            this.dtmEffectiveDate.PostValidation.Intervals.AddRange(new C1.Win.C1Input.ValueInterval[] {
																										   ((C1.Win.C1Input.ValueInterval)(resources.GetObject("dtmEffectiveDate.PostValidation.Intervals")))});
            this.dtmEffectiveDate.PostValidation.Validation = ((C1.Win.C1Input.PostValidationTypeEnum)(resources.GetObject("dtmEffectiveDate.PostValidation.Validation")));
            this.dtmEffectiveDate.PostValidation.Values = ((System.Array)(resources.GetObject("dtmEffectiveDate.PostValidation.Values")));
            this.dtmEffectiveDate.PostValidation.ValuesExcluded = ((System.Array)(resources.GetObject("dtmEffectiveDate.PostValidation.ValuesExcluded")));
            this.dtmEffectiveDate.PreValidation.CaseSensitive = ((bool)(resources.GetObject("dtmEffectiveDate.PreValidation.CaseSensitive")));
            this.dtmEffectiveDate.PreValidation.ErrorMessage = resources.GetString("dtmEffectiveDate.PreValidation.ErrorMessage");
            this.dtmEffectiveDate.PreValidation.Inherit = ((C1.Win.C1Input.PreValidationInheritFlags)(resources.GetObject("dtmEffectiveDate.PreValidation.Inherit")));
            this.dtmEffectiveDate.PreValidation.ItemSeparator = resources.GetString("dtmEffectiveDate.PreValidation.ItemSeparator");
            this.dtmEffectiveDate.PreValidation.PatternString = resources.GetString("dtmEffectiveDate.PreValidation.PatternString");
            this.dtmEffectiveDate.PreValidation.RegexOptions = ((C1.Win.C1Input.RegexOptionFlags)(resources.GetObject("dtmEffectiveDate.PreValidation.RegexOptions")));
            this.dtmEffectiveDate.PreValidation.TrimEnd = ((bool)(resources.GetObject("dtmEffectiveDate.PreValidation.TrimEnd")));
            this.dtmEffectiveDate.PreValidation.TrimStart = ((bool)(resources.GetObject("dtmEffectiveDate.PreValidation.TrimStart")));
            this.dtmEffectiveDate.PreValidation.Validation = ((C1.Win.C1Input.PreValidationTypeEnum)(resources.GetObject("dtmEffectiveDate.PreValidation.Validation")));
            this.dtmEffectiveDate.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("dtmEffectiveDate.RightToLeft")));
            this.dtmEffectiveDate.ShowFocusRectangle = ((bool)(resources.GetObject("dtmEffectiveDate.ShowFocusRectangle")));
            this.dtmEffectiveDate.Size = ((System.Drawing.Size)(resources.GetObject("dtmEffectiveDate.Size")));
            this.dtmEffectiveDate.TabIndex = ((int)(resources.GetObject("dtmEffectiveDate.TabIndex")));
            this.dtmEffectiveDate.Tag = ((object)(resources.GetObject("dtmEffectiveDate.Tag")));
            this.dtmEffectiveDate.TextAlign = ((System.Windows.Forms.HorizontalAlignment)(resources.GetObject("dtmEffectiveDate.TextAlign")));
            this.dtmEffectiveDate.TrimEnd = ((bool)(resources.GetObject("dtmEffectiveDate.TrimEnd")));
            this.dtmEffectiveDate.TrimStart = ((bool)(resources.GetObject("dtmEffectiveDate.TrimStart")));
            this.dtmEffectiveDate.UserCultureOverride = ((bool)(resources.GetObject("dtmEffectiveDate.UserCultureOverride")));
            this.dtmEffectiveDate.Value = ((object)(resources.GetObject("dtmEffectiveDate.Value")));
            this.dtmEffectiveDate.VerticalAlign = ((C1.Win.C1Input.VerticalAlignEnum)(resources.GetObject("dtmEffectiveDate.VerticalAlign")));
            this.dtmEffectiveDate.Visible = ((bool)(resources.GetObject("dtmEffectiveDate.Visible")));
            this.dtmEffectiveDate.VisibleButtons = ((C1.Win.C1Input.DropDownControlButtonFlags)(resources.GetObject("dtmEffectiveDate.VisibleButtons")));
            this.dtmEffectiveDate.ValueChanged += new System.EventHandler(this.dtmEffectiveDate_ValueChanged);
            this.dtmEffectiveDate.Enter += new System.EventHandler(this.dtmEffectiveDate_Enter);
            this.dtmEffectiveDate.DropDownClosed += new DropDownClosedEventHandler(this.dtmEffectiveDate_DropDownClosed);
            // 
            // txtModel
            // 
            this.txtModel.AccessibleDescription = resources.GetString("txtModel.AccessibleDescription");
            this.txtModel.AccessibleName = resources.GetString("txtModel.AccessibleName");
            this.txtModel.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("txtModel.Anchor")));
            this.txtModel.AutoSize = ((bool)(resources.GetObject("txtModel.AutoSize")));
            this.txtModel.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("txtModel.BackgroundImage")));
            this.txtModel.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("txtModel.Dock")));
            this.txtModel.Enabled = ((bool)(resources.GetObject("txtModel.Enabled")));
            this.txtModel.Font = ((System.Drawing.Font)(resources.GetObject("txtModel.Font")));
            this.txtModel.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("txtModel.ImeMode")));
            this.txtModel.Location = ((System.Drawing.Point)(resources.GetObject("txtModel.Location")));
            this.txtModel.MaxLength = ((int)(resources.GetObject("txtModel.MaxLength")));
            this.txtModel.Multiline = ((bool)(resources.GetObject("txtModel.Multiline")));
            this.txtModel.Name = "txtModel";
            this.txtModel.PasswordChar = ((char)(resources.GetObject("txtModel.PasswordChar")));
            this.txtModel.ReadOnly = true;
            this.txtModel.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("txtModel.RightToLeft")));
            this.txtModel.ScrollBars = ((System.Windows.Forms.ScrollBars)(resources.GetObject("txtModel.ScrollBars")));
            this.txtModel.Size = ((System.Drawing.Size)(resources.GetObject("txtModel.Size")));
            this.txtModel.TabIndex = ((int)(resources.GetObject("txtModel.TabIndex")));
            this.txtModel.TabStop = false;
            this.txtModel.Text = resources.GetString("txtModel.Text");
            this.txtModel.TextAlign = ((System.Windows.Forms.HorizontalAlignment)(resources.GetObject("txtModel.TextAlign")));
            this.txtModel.Visible = ((bool)(resources.GetObject("txtModel.Visible")));
            this.txtModel.WordWrap = ((bool)(resources.GetObject("txtModel.WordWrap")));
            // 
            // txtPartName
            // 
            this.txtPartName.AccessibleDescription = resources.GetString("txtPartName.AccessibleDescription");
            this.txtPartName.AccessibleName = resources.GetString("txtPartName.AccessibleName");
            this.txtPartName.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("txtPartName.Anchor")));
            this.txtPartName.AutoSize = ((bool)(resources.GetObject("txtPartName.AutoSize")));
            this.txtPartName.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("txtPartName.BackgroundImage")));
            this.txtPartName.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("txtPartName.Dock")));
            this.txtPartName.Enabled = ((bool)(resources.GetObject("txtPartName.Enabled")));
            this.txtPartName.Font = ((System.Drawing.Font)(resources.GetObject("txtPartName.Font")));
            this.txtPartName.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("txtPartName.ImeMode")));
            this.txtPartName.Location = ((System.Drawing.Point)(resources.GetObject("txtPartName.Location")));
            this.txtPartName.MaxLength = ((int)(resources.GetObject("txtPartName.MaxLength")));
            this.txtPartName.Multiline = ((bool)(resources.GetObject("txtPartName.Multiline")));
            this.txtPartName.Name = "txtPartName";
            this.txtPartName.PasswordChar = ((char)(resources.GetObject("txtPartName.PasswordChar")));
            this.txtPartName.ReadOnly = true;
            this.txtPartName.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("txtPartName.RightToLeft")));
            this.txtPartName.ScrollBars = ((System.Windows.Forms.ScrollBars)(resources.GetObject("txtPartName.ScrollBars")));
            this.txtPartName.Size = ((System.Drawing.Size)(resources.GetObject("txtPartName.Size")));
            this.txtPartName.TabIndex = ((int)(resources.GetObject("txtPartName.TabIndex")));
            this.txtPartName.TabStop = false;
            this.txtPartName.Text = resources.GetString("txtPartName.Text");
            this.txtPartName.TextAlign = ((System.Windows.Forms.HorizontalAlignment)(resources.GetObject("txtPartName.TextAlign")));
            this.txtPartName.Visible = ((bool)(resources.GetObject("txtPartName.Visible")));
            this.txtPartName.WordWrap = ((bool)(resources.GetObject("txtPartName.WordWrap")));
            // 
            // txtIncrement
            // 
            this.txtIncrement.AcceptsEscape = ((bool)(resources.GetObject("txtIncrement.AcceptsEscape")));
            this.txtIncrement.AccessibleDescription = resources.GetString("txtIncrement.AccessibleDescription");
            this.txtIncrement.AccessibleName = resources.GetString("txtIncrement.AccessibleName");
            this.txtIncrement.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("txtIncrement.Anchor")));
            this.txtIncrement.AutoSize = ((bool)(resources.GetObject("txtIncrement.AutoSize")));
            this.txtIncrement.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("txtIncrement.BackgroundImage")));
            this.txtIncrement.BorderStyle = ((System.Windows.Forms.BorderStyle)(resources.GetObject("txtIncrement.BorderStyle")));
            // 
            // txtIncrement.Calculator
            // 
            this.txtIncrement.Calculator.AccessibleDescription = resources.GetString("txtIncrement.Calculator.AccessibleDescription");
            this.txtIncrement.Calculator.AccessibleName = resources.GetString("txtIncrement.Calculator.AccessibleName");
            this.txtIncrement.Calculator.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("txtIncrement.Calculator.BackgroundImage")));
            this.txtIncrement.Calculator.ButtonFlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("txtIncrement.Calculator.ButtonFlatStyle")));
            this.txtIncrement.Calculator.DisplayFormat = resources.GetString("txtIncrement.Calculator.DisplayFormat");
            this.txtIncrement.Calculator.Font = ((System.Drawing.Font)(resources.GetObject("txtIncrement.Calculator.Font")));
            this.txtIncrement.Calculator.FormatOnClose = ((bool)(resources.GetObject("txtIncrement.Calculator.FormatOnClose")));
            this.txtIncrement.Calculator.StoredFormat = resources.GetString("txtIncrement.Calculator.StoredFormat");
            this.txtIncrement.Calculator.UIStrings.Content = ((string[])(resources.GetObject("txtIncrement.Calculator.UIStrings.Content")));
            this.txtIncrement.CaseSensitive = ((bool)(resources.GetObject("txtIncrement.CaseSensitive")));
            this.txtIncrement.Culture = ((int)(resources.GetObject("txtIncrement.Culture")));
            this.txtIncrement.CustomFormat = resources.GetString("txtIncrement.CustomFormat");
            this.txtIncrement.DataType = ((System.Type)(resources.GetObject("txtIncrement.DataType")));
            this.txtIncrement.DisplayFormat.CustomFormat = resources.GetString("txtIncrement.DisplayFormat.CustomFormat");
            this.txtIncrement.DisplayFormat.FormatType = ((C1.Win.C1Input.FormatTypeEnum)(resources.GetObject("txtIncrement.DisplayFormat.FormatType")));
            this.txtIncrement.DisplayFormat.Inherit = ((C1.Win.C1Input.FormatInfoInheritFlags)(resources.GetObject("txtIncrement.DisplayFormat.Inherit")));
            this.txtIncrement.DisplayFormat.NullText = resources.GetString("txtIncrement.DisplayFormat.NullText");
            this.txtIncrement.DisplayFormat.TrimEnd = ((bool)(resources.GetObject("txtIncrement.DisplayFormat.TrimEnd")));
            this.txtIncrement.DisplayFormat.TrimStart = ((bool)(resources.GetObject("txtIncrement.DisplayFormat.TrimStart")));
            this.txtIncrement.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("txtIncrement.Dock")));
            this.txtIncrement.DropDownFormAlign = ((C1.Win.C1Input.DropDownFormAlignmentEnum)(resources.GetObject("txtIncrement.DropDownFormAlign")));
            this.txtIncrement.EditFormat.CustomFormat = resources.GetString("txtIncrement.EditFormat.CustomFormat");
            this.txtIncrement.EditFormat.FormatType = ((C1.Win.C1Input.FormatTypeEnum)(resources.GetObject("txtIncrement.EditFormat.FormatType")));
            this.txtIncrement.EditFormat.Inherit = ((C1.Win.C1Input.FormatInfoInheritFlags)(resources.GetObject("txtIncrement.EditFormat.Inherit")));
            this.txtIncrement.EditFormat.NullText = resources.GetString("txtIncrement.EditFormat.NullText");
            this.txtIncrement.EditFormat.TrimEnd = ((bool)(resources.GetObject("txtIncrement.EditFormat.TrimEnd")));
            this.txtIncrement.EditFormat.TrimStart = ((bool)(resources.GetObject("txtIncrement.EditFormat.TrimStart")));
            this.txtIncrement.EditMask = resources.GetString("txtIncrement.EditMask");
            this.txtIncrement.EmptyAsNull = ((bool)(resources.GetObject("txtIncrement.EmptyAsNull")));
            this.txtIncrement.Enabled = ((bool)(resources.GetObject("txtIncrement.Enabled")));
            this.txtIncrement.ErrorInfo.BeepOnError = ((bool)(resources.GetObject("txtIncrement.ErrorInfo.BeepOnError")));
            this.txtIncrement.ErrorInfo.ErrorMessage = resources.GetString("txtIncrement.ErrorInfo.ErrorMessage");
            this.txtIncrement.ErrorInfo.ErrorMessageCaption = resources.GetString("txtIncrement.ErrorInfo.ErrorMessageCaption");
            this.txtIncrement.ErrorInfo.ShowErrorMessage = ((bool)(resources.GetObject("txtIncrement.ErrorInfo.ShowErrorMessage")));
            this.txtIncrement.ErrorInfo.ValueOnError = ((object)(resources.GetObject("txtIncrement.ErrorInfo.ValueOnError")));
            this.txtIncrement.Font = ((System.Drawing.Font)(resources.GetObject("txtIncrement.Font")));
            this.txtIncrement.FormatType = ((C1.Win.C1Input.FormatTypeEnum)(resources.GetObject("txtIncrement.FormatType")));
            this.txtIncrement.GapHeight = ((int)(resources.GetObject("txtIncrement.GapHeight")));
            this.txtIncrement.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("txtIncrement.ImeMode")));
            this.txtIncrement.Increment = ((object)(resources.GetObject("txtIncrement.Increment")));
            this.txtIncrement.InitialSelection = ((C1.Win.C1Input.InitialSelectionEnum)(resources.GetObject("txtIncrement.InitialSelection")));
            this.txtIncrement.Location = ((System.Drawing.Point)(resources.GetObject("txtIncrement.Location")));
            this.txtIncrement.MaskInfo.AutoTabWhenFilled = ((bool)(resources.GetObject("txtIncrement.MaskInfo.AutoTabWhenFilled")));
            this.txtIncrement.MaskInfo.CaseSensitive = ((bool)(resources.GetObject("txtIncrement.MaskInfo.CaseSensitive")));
            this.txtIncrement.MaskInfo.CopyWithLiterals = ((bool)(resources.GetObject("txtIncrement.MaskInfo.CopyWithLiterals")));
            this.txtIncrement.MaskInfo.EditMask = resources.GetString("txtIncrement.MaskInfo.EditMask");
            this.txtIncrement.MaskInfo.EmptyAsNull = ((bool)(resources.GetObject("txtIncrement.MaskInfo.EmptyAsNull")));
            this.txtIncrement.MaskInfo.ErrorMessage = resources.GetString("txtIncrement.MaskInfo.ErrorMessage");
            this.txtIncrement.MaskInfo.Inherit = ((C1.Win.C1Input.MaskInfoInheritFlags)(resources.GetObject("txtIncrement.MaskInfo.Inherit")));
            this.txtIncrement.MaskInfo.PromptChar = ((char)(resources.GetObject("txtIncrement.MaskInfo.PromptChar")));
            this.txtIncrement.MaskInfo.ShowLiterals = ((C1.Win.C1Input.ShowLiteralsEnum)(resources.GetObject("txtIncrement.MaskInfo.ShowLiterals")));
            this.txtIncrement.MaskInfo.StoredEmptyChar = ((char)(resources.GetObject("txtIncrement.MaskInfo.StoredEmptyChar")));
            this.txtIncrement.MaxLength = ((int)(resources.GetObject("txtIncrement.MaxLength")));
            this.txtIncrement.Name = "txtIncrement";
            this.txtIncrement.NullText = resources.GetString("txtIncrement.NullText");
            this.txtIncrement.NumericInputKeys = ((C1.Win.C1Input.NumericInputKeyFlags)(((C1.Win.C1Input.NumericInputKeyFlags.F9 | C1.Win.C1Input.NumericInputKeyFlags.Plus)
                | C1.Win.C1Input.NumericInputKeyFlags.X)));
            this.txtIncrement.ParseInfo.CaseSensitive = ((bool)(resources.GetObject("txtIncrement.ParseInfo.CaseSensitive")));
            this.txtIncrement.ParseInfo.CustomFormat = resources.GetString("txtIncrement.ParseInfo.CustomFormat");
            this.txtIncrement.ParseInfo.EmptyAsNull = ((bool)(resources.GetObject("txtIncrement.ParseInfo.EmptyAsNull")));
            this.txtIncrement.ParseInfo.ErrorMessage = resources.GetString("txtIncrement.ParseInfo.ErrorMessage");
            this.txtIncrement.ParseInfo.FormatType = ((C1.Win.C1Input.FormatTypeEnum)(resources.GetObject("txtIncrement.ParseInfo.FormatType")));
            this.txtIncrement.ParseInfo.Inherit = ((C1.Win.C1Input.ParseInfoInheritFlags)(resources.GetObject("txtIncrement.ParseInfo.Inherit")));
            this.txtIncrement.ParseInfo.NullText = resources.GetString("txtIncrement.ParseInfo.NullText");
            this.txtIncrement.ParseInfo.NumberStyle = ((C1.Win.C1Input.NumberStyleFlags)(resources.GetObject("txtIncrement.ParseInfo.NumberStyle")));
            this.txtIncrement.ParseInfo.TrimEnd = ((bool)(resources.GetObject("txtIncrement.ParseInfo.TrimEnd")));
            this.txtIncrement.ParseInfo.TrimStart = ((bool)(resources.GetObject("txtIncrement.ParseInfo.TrimStart")));
            this.txtIncrement.PasswordChar = ((char)(resources.GetObject("txtIncrement.PasswordChar")));
            this.txtIncrement.PostValidation.CaseSensitive = ((bool)(resources.GetObject("txtIncrement.PostValidation.CaseSensitive")));
            this.txtIncrement.PostValidation.ErrorMessage = resources.GetString("txtIncrement.PostValidation.ErrorMessage");
            this.txtIncrement.PostValidation.Inherit = ((C1.Win.C1Input.PostValidationInheritFlags)(resources.GetObject("txtIncrement.PostValidation.Inherit")));
            this.txtIncrement.PostValidation.Intervals.AddRange(new C1.Win.C1Input.ValueInterval[] {
																									   ((C1.Win.C1Input.ValueInterval)(resources.GetObject("txtIncrement.PostValidation.Intervals")))});
            this.txtIncrement.PostValidation.Validation = ((C1.Win.C1Input.PostValidationTypeEnum)(resources.GetObject("txtIncrement.PostValidation.Validation")));
            this.txtIncrement.PostValidation.Values = ((System.Array)(resources.GetObject("txtIncrement.PostValidation.Values")));
            this.txtIncrement.PostValidation.ValuesExcluded = ((System.Array)(resources.GetObject("txtIncrement.PostValidation.ValuesExcluded")));
            this.txtIncrement.PreValidation.CaseSensitive = ((bool)(resources.GetObject("txtIncrement.PreValidation.CaseSensitive")));
            this.txtIncrement.PreValidation.ErrorMessage = resources.GetString("txtIncrement.PreValidation.ErrorMessage");
            this.txtIncrement.PreValidation.Inherit = ((C1.Win.C1Input.PreValidationInheritFlags)(resources.GetObject("txtIncrement.PreValidation.Inherit")));
            this.txtIncrement.PreValidation.ItemSeparator = resources.GetString("txtIncrement.PreValidation.ItemSeparator");
            this.txtIncrement.PreValidation.PatternString = resources.GetString("txtIncrement.PreValidation.PatternString");
            this.txtIncrement.PreValidation.RegexOptions = ((C1.Win.C1Input.RegexOptionFlags)(resources.GetObject("txtIncrement.PreValidation.RegexOptions")));
            this.txtIncrement.PreValidation.TrimEnd = ((bool)(resources.GetObject("txtIncrement.PreValidation.TrimEnd")));
            this.txtIncrement.PreValidation.TrimStart = ((bool)(resources.GetObject("txtIncrement.PreValidation.TrimStart")));
            this.txtIncrement.PreValidation.Validation = ((C1.Win.C1Input.PreValidationTypeEnum)(resources.GetObject("txtIncrement.PreValidation.Validation")));
            this.txtIncrement.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("txtIncrement.RightToLeft")));
            this.txtIncrement.ShowFocusRectangle = ((bool)(resources.GetObject("txtIncrement.ShowFocusRectangle")));
            this.txtIncrement.Size = ((System.Drawing.Size)(resources.GetObject("txtIncrement.Size")));
            this.txtIncrement.TabIndex = ((int)(resources.GetObject("txtIncrement.TabIndex")));
            this.txtIncrement.Tag = ((object)(resources.GetObject("txtIncrement.Tag")));
            this.txtIncrement.TextAlign = ((System.Windows.Forms.HorizontalAlignment)(resources.GetObject("txtIncrement.TextAlign")));
            this.txtIncrement.TrimEnd = ((bool)(resources.GetObject("txtIncrement.TrimEnd")));
            this.txtIncrement.TrimStart = ((bool)(resources.GetObject("txtIncrement.TrimStart")));
            this.txtIncrement.UserCultureOverride = ((bool)(resources.GetObject("txtIncrement.UserCultureOverride")));
            this.txtIncrement.Value = ((object)(resources.GetObject("txtIncrement.Value")));
            this.txtIncrement.VerticalAlign = ((C1.Win.C1Input.VerticalAlignEnum)(resources.GetObject("txtIncrement.VerticalAlign")));
            this.txtIncrement.Visible = ((bool)(resources.GetObject("txtIncrement.Visible")));
            this.txtIncrement.VisibleButtons = ((C1.Win.C1Input.DropDownControlButtonFlags)(resources.GetObject("txtIncrement.VisibleButtons")));
            this.txtIncrement.Enter += new System.EventHandler(this.OnEnterControl);
            this.txtIncrement.Leave += new System.EventHandler(this.OnLeaveControl);
            // 
            // txtWorkCenter
            // 
            this.txtWorkCenter.AccessibleDescription = resources.GetString("txtWorkCenter.AccessibleDescription");
            this.txtWorkCenter.AccessibleName = resources.GetString("txtWorkCenter.AccessibleName");
            this.txtWorkCenter.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("txtWorkCenter.Anchor")));
            this.txtWorkCenter.AutoSize = ((bool)(resources.GetObject("txtWorkCenter.AutoSize")));
            this.txtWorkCenter.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("txtWorkCenter.BackgroundImage")));
            this.txtWorkCenter.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("txtWorkCenter.Dock")));
            this.txtWorkCenter.Enabled = ((bool)(resources.GetObject("txtWorkCenter.Enabled")));
            this.txtWorkCenter.Font = ((System.Drawing.Font)(resources.GetObject("txtWorkCenter.Font")));
            this.txtWorkCenter.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("txtWorkCenter.ImeMode")));
            this.txtWorkCenter.Location = ((System.Drawing.Point)(resources.GetObject("txtWorkCenter.Location")));
            this.txtWorkCenter.MaxLength = ((int)(resources.GetObject("txtWorkCenter.MaxLength")));
            this.txtWorkCenter.Multiline = ((bool)(resources.GetObject("txtWorkCenter.Multiline")));
            this.txtWorkCenter.Name = "txtWorkCenter";
            this.txtWorkCenter.PasswordChar = ((char)(resources.GetObject("txtWorkCenter.PasswordChar")));
            this.txtWorkCenter.ReadOnly = true;
            this.txtWorkCenter.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("txtWorkCenter.RightToLeft")));
            this.txtWorkCenter.ScrollBars = ((System.Windows.Forms.ScrollBars)(resources.GetObject("txtWorkCenter.ScrollBars")));
            this.txtWorkCenter.Size = ((System.Drawing.Size)(resources.GetObject("txtWorkCenter.Size")));
            this.txtWorkCenter.TabIndex = ((int)(resources.GetObject("txtWorkCenter.TabIndex")));
            this.txtWorkCenter.Text = resources.GetString("txtWorkCenter.Text");
            this.txtWorkCenter.TextAlign = ((System.Windows.Forms.HorizontalAlignment)(resources.GetObject("txtWorkCenter.TextAlign")));
            this.txtWorkCenter.Visible = ((bool)(resources.GetObject("txtWorkCenter.Visible")));
            this.txtWorkCenter.WordWrap = ((bool)(resources.GetObject("txtWorkCenter.WordWrap")));
            // 
            // lblWorkcenter
            // 
            this.lblWorkcenter.AccessibleDescription = resources.GetString("lblWorkcenter.AccessibleDescription");
            this.lblWorkcenter.AccessibleName = resources.GetString("lblWorkcenter.AccessibleName");
            this.lblWorkcenter.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("lblWorkcenter.Anchor")));
            this.lblWorkcenter.AutoSize = ((bool)(resources.GetObject("lblWorkcenter.AutoSize")));
            this.lblWorkcenter.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("lblWorkcenter.Dock")));
            this.lblWorkcenter.Enabled = ((bool)(resources.GetObject("lblWorkcenter.Enabled")));
            this.lblWorkcenter.Font = ((System.Drawing.Font)(resources.GetObject("lblWorkcenter.Font")));
            this.lblWorkcenter.Image = ((System.Drawing.Image)(resources.GetObject("lblWorkcenter.Image")));
            this.lblWorkcenter.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblWorkcenter.ImageAlign")));
            this.lblWorkcenter.ImageIndex = ((int)(resources.GetObject("lblWorkcenter.ImageIndex")));
            this.lblWorkcenter.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("lblWorkcenter.ImeMode")));
            this.lblWorkcenter.Location = ((System.Drawing.Point)(resources.GetObject("lblWorkcenter.Location")));
            this.lblWorkcenter.Name = "lblWorkcenter";
            this.lblWorkcenter.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("lblWorkcenter.RightToLeft")));
            this.lblWorkcenter.Size = ((System.Drawing.Size)(resources.GetObject("lblWorkcenter.Size")));
            this.lblWorkcenter.TabIndex = ((int)(resources.GetObject("lblWorkcenter.TabIndex")));
            this.lblWorkcenter.Text = resources.GetString("lblWorkcenter.Text");
            this.lblWorkcenter.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblWorkcenter.TextAlign")));
            this.lblWorkcenter.Visible = ((bool)(resources.GetObject("lblWorkcenter.Visible")));
            // 
            // Bom
            // 
            this.AccessibleDescription = resources.GetString("$this.AccessibleDescription");
            this.AccessibleName = resources.GetString("$this.AccessibleName");
            this.AutoScaleBaseSize = ((System.Drawing.Size)(resources.GetObject("$this.AutoScaleBaseSize")));
            this.AutoScroll = ((bool)(resources.GetObject("$this.AutoScroll")));
            this.AutoScrollMargin = ((System.Drawing.Size)(resources.GetObject("$this.AutoScrollMargin")));
            this.AutoScrollMinSize = ((System.Drawing.Size)(resources.GetObject("$this.AutoScrollMinSize")));
            this.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("$this.BackgroundImage")));
            this.CancelButton = this.btnOK;
            this.ClientSize = ((System.Drawing.Size)(resources.GetObject("$this.ClientSize")));
            this.Controls.Add(this.txtWorkCenter);
            this.Controls.Add(this.dgrdData);
            this.Controls.Add(this.txtPartName);
            this.Controls.Add(this.txtModel);
            this.Controls.Add(this.txtBOMDes);
            this.Controls.Add(this.txtItemCode);
            this.Controls.Add(this.lblWorkcenter);
            this.Controls.Add(this.txtIncrement);
            this.Controls.Add(this.dtmEffectiveDate);
            this.Controls.Add(this.chkMakeItem);
            this.Controls.Add(this.btnFindItem);
            this.Controls.Add(this.lblRevision);
            this.Controls.Add(this.lblPartName);
            this.Controls.Add(this.lblPartNumber);
            this.Controls.Add(this.lblBomDes);
            this.Controls.Add(this.lblIncre);
            this.Controls.Add(this.cboCCN);
            this.Controls.Add(this.lblCCN);
            this.Controls.Add(this.btnHelp);
            this.Controls.Add(this.btnSave);
            this.Controls.Add(this.btnAdd);
            this.Controls.Add(this.btnEdit);
            this.Controls.Add(this.btnOK);
            this.Controls.Add(this.btnDelete);
            this.Enabled = ((bool)(resources.GetObject("$this.Enabled")));
            this.Font = ((System.Drawing.Font)(resources.GetObject("$this.Font")));
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
            this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
            this.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("$this.ImeMode")));
            this.KeyPreview = true;
            this.Location = ((System.Drawing.Point)(resources.GetObject("$this.Location")));
            this.MaximumSize = ((System.Drawing.Size)(resources.GetObject("$this.MaximumSize")));
            this.MinimumSize = ((System.Drawing.Size)(resources.GetObject("$this.MinimumSize")));
            this.Name = "Bom";
            this.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("$this.RightToLeft")));
            this.StartPosition = ((System.Windows.Forms.FormStartPosition)(resources.GetObject("$this.StartPosition")));
            this.Text = resources.GetString("$this.Text");
            this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Bom_KeyDown);
            this.Closing += new System.ComponentModel.CancelEventHandler(this.Bom_Closing);
            this.Load += new System.EventHandler(this.Bom_Load);
            ((System.ComponentModel.ISupportInitialize)(this.dgrdData)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.cboCCN)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.dtmEffectiveDate)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.txtIncrement)).EndInit();
            this.ResumeLayout(false);

        }
        #endregion

        private void ResetForm()
        {
            txtBOMDes.Text = string.Empty;
            txtItemCode.Text = string.Empty;
            txtModel.Text = string.Empty;
            txtPartName.Text = string.Empty;
            txtIncrement.Value = null;
            enumAction = EnumAction.Default;

            //CaptionLine = dgrdData.Columns[CaptionLine].Caption;
            //CaptionOperation = dgrdData.Columns[CaptionOperation].Caption;

            txtItemCode.Focus();
        }
        private void LoadComboCCN()
        {
            const string METHOD_NAME = THIS + ".LoadComboCCN()";
            try
            {
                UtilsBO boUtils = new UtilsBO();
                DataSet dstCCN = boUtils.ListCCN();
                cboCCN.DataSource = dstCCN.Tables[MST_CCNTable.TABLE_NAME];
                cboCCN.DisplayMember = MST_CCNTable.CODE_FLD;
                cboCCN.ValueMember = MST_CCNTable.CCNID_FLD;
                FormControlComponents.PutDataIntoC1ComboBox(cboCCN, dstCCN.Tables[MST_CCNTable.TABLE_NAME], MST_CCNTable.CODE_FLD, MST_CCNTable.CCNID_FLD, MST_CCNTable.TABLE_NAME);
                if (SystemProperty.CCNID != 0)
                {
                    cboCCN.SelectedValue = SystemProperty.CCNID;
                }
            }
            catch (PCSException ex)
            {
                throw new PCSException(ex.mCode, METHOD_NAME, ex);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
        }
        private void GetDataOfBomFromDataRow(DataRow drowData)
        {
            const string METHOD_NAME = THIS + ".GetDataOfBomFromDataRow()";
            try
            {
                dstBOMDetail = new DataSet();
                voProduct.ProductID = int.Parse(drowData[ITM_ProductTable.PRODUCTID_FLD].ToString());
                txtItemCode.Text = drowData[ITM_ProductTable.CODE_FLD].ToString();
                txtModel.Text = drowData[ITM_ProductTable.REVISION_FLD].ToString();
                txtPartName.Text = drowData[ITM_ProductTable.DESCRIPTION_FLD].ToString();
                chkMakeItem.Checked = bool.Parse(drowData[ITM_ProductTable.MAKEITEM_FLD].ToString());
                txtBOMDes.Text = drowData[ITM_ProductTable.BOMDESCRIPTION_FLD].ToString();
                txtIncrement.Value = drowData[ITM_ProductTable.BOMINCREMENT_FLD];

                if (dstBOMDetail.Tables.Count == 0)
                {
                    CreateTableForGrid(2);
                    dstBOMDetail.Tables.Add(new BomBO().ListBOMDetailsOfProduct(voProduct.ProductID).Copy());
                    dstBOMDetail.Tables.Add(new BomBO().ListHierarchyOfProduct(voProduct.ProductID).Copy());
                }
                if (txtIncrement.Value.ToString().Trim() == "0")
                {
                    txtIncrement.Value = 1;
                }
                intRowCountDelete = 0;
                dgrdData.DataSource = dstBOMDetail.Tables[ITM_BOMTable.TABLE_NAME];
                FormControlComponents.RestoreGridLayout(dgrdData, dtbGridLayout);
                EnableDisableButton(enumAction);
                if (enumAction != EnumAction.Add)
                {
                    btnEdit.Enabled = true;
                    dgrdData.AllowDelete = false;
                    btnDelete.Enabled = true;
                }
                txtItemCode.Modified = false;
                ConfigGridLayout();
            }
            catch (PCSException ex)
            {
                throw new PCSException(ex.mCode, METHOD_NAME, ex);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
        }
        private void btnFindItem_Click(object sender, System.EventArgs e)
        {
            const string METHOD_NAME = THIS + ".btnFindSaleOrder_Click()";
            try
            {
                DataRowView drwResult = null;
                Hashtable htbConditon = new Hashtable();
                if (cboCCN.SelectedValue != null)
                {
                    htbConditon.Add(ITM_ProductTable.CCNID_FLD, cboCCN.SelectedValue.ToString());
                    htbConditon.Add(ITM_ProductTable.MAKEITEM_FLD, 1);
                    if (enumAction == EnumAction.Add)
                    {
                        htbConditon.Add(v_ITMBOM_Product.HASBOM_FLD, 0);
                    }
                    else
                    {
                        htbConditon.Add(v_ITMBOM_Product.HASBOM_FLD, 1);
                    }
                }
                else
                {
                    PCSMessageBox.Show(ErrorCode.MESSAGE_RGA_CCN, MessageBoxIcon.Warning);
                    cboCCN.Focus();
                    return;
                }
                drwResult = FormControlComponents.OpenSearchForm(v_ITMBOM_Product.VIEW_NAME, ITM_ProductTable.CODE_FLD, txtItemCode.Text, htbConditon, true);
                if (drwResult != null)
                {
                    GetDataOfBomFromDataRow(drwResult.Row);
                    voProduct.Code = txtItemCode.Text.Trim();
                }
                else
                {
                    txtItemCode.Focus();
                }
            }
            catch (PCSException ex)
            {
                PCSMessageBox.Show(ex.mCode, MessageBoxIcon.Error);
                try
                {
                    Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxIcon.Error);
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
                }
            }
        }
        public void GetProductInfors(DataRow drowData)
        {
            const string METHOD_NAME = THIS + ".GetProductInfors()";
            try
            {
                txtItemCode.Text = drowData[ITM_ProductTable.CODE_FLD].ToString().Trim();
                txtModel.Text = drowData[ITM_ProductTable.REVISION_FLD].ToString().Trim();
                txtPartName.Text = drowData[ITM_ProductTable.DESCRIPTION_FLD].ToString().Trim();
                chkMakeItem.Checked = bool.Parse(drowData[ITM_ProductTable.MAKEITEM_FLD].ToString().Trim());
                txtBOMDes.Text = drowData[ITM_ProductTable.BOMDESCRIPTION_FLD].ToString().Trim();
                txtIncrement.Value = drowData[ITM_ProductTable.BOMINCREMENT_FLD].ToString().Trim();

                voProduct.ProductID = int.Parse(drowData[ITM_ProductTable.PRODUCTID_FLD].ToString().Trim());
                voProduct.Code = drowData[ITM_ProductTable.CODE_FLD].ToString().Trim();
            }
            catch (PCSException ex)
            {
                throw new PCSException(ex.mCode, METHOD_NAME, ex);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
        }
        private void CreateTableForGrid(int intType)
        {
            const string METHOD_NAME = THIS + ".CreateTableForGrid()-";
            try
            {
                dstBOMDetail = new DataSet();
                if (intType == 1)
                {
                    dstBOMDetail.Tables.Add(ITM_BOMTable.TABLE_NAME);
                    //Bom table
                    dstBOMDetail.Tables[ITM_BOMTable.TABLE_NAME].Columns.Add(CaptionLine);
                    dstBOMDetail.Tables[ITM_BOMTable.TABLE_NAME].Columns.Add(ITM_BOMTable.BOMID_FLD);
                    dstBOMDetail.Tables[ITM_BOMTable.TABLE_NAME].Columns.Add(ITM_BOMTable.PRODUCTID_FLD);
                    dstBOMDetail.Tables[ITM_BOMTable.TABLE_NAME].Columns.Add(ITM_BOMTable.COMPONENTID_FLD);
                    dstBOMDetail.Tables[ITM_BOMTable.TABLE_NAME].Columns.Add(ITM_ProductTable.CODE_FLD);

                    dstBOMDetail.Tables[ITM_BOMTable.TABLE_NAME].Columns.Add(ITM_ProductTable.DESCRIPTION_FLD);
                    dstBOMDetail.Tables[ITM_BOMTable.TABLE_NAME].Columns.Add(ITM_ProductTable.REVISION_FLD);

                    dstBOMDetail.Tables[ITM_BOMTable.TABLE_NAME].Columns.Add(WorkCenterCode);

                    dstBOMDetail.Tables[ITM_BOMTable.TABLE_NAME].Columns.Add(StockUMCode);
                    dstBOMDetail.Tables[ITM_BOMTable.TABLE_NAME].Columns.Add(ITM_CategoryTable.TABLE_NAME + ITM_CategoryTable.CODE_FLD);
                    dstBOMDetail.Tables[ITM_BOMTable.TABLE_NAME].Columns.Add(MST_PartyTable.TABLE_NAME + MST_PartyTable.CODE_FLD);
                    dstBOMDetail.Tables[ITM_BOMTable.TABLE_NAME].Columns.Add(ITM_ProductTable.STOCKUMID_FLD);
                    dstBOMDetail.Tables[ITM_BOMTable.TABLE_NAME].Columns.Add(ITM_BOMTable.QUANTITY_FLD);
                    dstBOMDetail.Tables[ITM_BOMTable.TABLE_NAME].Columns.Add(ITM_BOMTable.ROUTINGID_FLD);
                    dstBOMDetail.Tables[ITM_BOMTable.TABLE_NAME].Columns.Add(CaptionOperation);

                    dstBOMDetail.Tables[ITM_BOMTable.TABLE_NAME].Columns.Add(ITM_BOMTable.LEADTIMEOFFSET_FLD);
                    dstBOMDetail.Tables[ITM_BOMTable.TABLE_NAME].Columns.Add(ITM_BOMTable.ALTERNATIVE_FLD);

                    dstBOMDetail.Tables[ITM_BOMTable.TABLE_NAME].Columns.Add(ITM_BOMTable.EFFECTIVEBEGINDATE_FLD, typeof(DateTime));
                    dstBOMDetail.Tables[ITM_BOMTable.TABLE_NAME].Columns.Add(ITM_BOMTable.EFFECTIVEENDDATE_FLD, typeof(DateTime));
                    dstBOMDetail.Tables[ITM_BOMTable.TABLE_NAME].Columns.Add(ITM_BOMTable.EFFECTIVEBEGINDAY_FLD);
                    dstBOMDetail.Tables[ITM_BOMTable.TABLE_NAME].Columns.Add(ITM_BOMTable.EFFECTIVEENDDAY_FLD);
                    dstBOMDetail.Tables[ITM_BOMTable.TABLE_NAME].Columns.Add(ITM_BOMTable.SHRINK_FLD);

                    dstBOMDetail.Tables.Add(ITM_HierarchyTable.TABLE_NAME);

                    //Hierarchy table
                    dstBOMDetail.Tables[ITM_HierarchyTable.TABLE_NAME].Columns.Add(ITM_HierarchyTable.HIERARCHYID_FLD);
                    dstBOMDetail.Tables[ITM_HierarchyTable.TABLE_NAME].Columns.Add(ITM_HierarchyTable.DES_FLD);
                    dstBOMDetail.Tables[ITM_HierarchyTable.TABLE_NAME].Columns.Add(ITM_HierarchyTable.SOURCE_FLD);
                }

                if (intType == 0)
                {
                    dstBOMDetail.Tables.Add(ITM_HierarchyTable.TABLE_NAME);

                    //Hierarchy table
                    dstBOMDetail.Tables[ITM_HierarchyTable.TABLE_NAME].Columns.Add(ITM_HierarchyTable.HIERARCHYID_FLD);
                    dstBOMDetail.Tables[ITM_HierarchyTable.TABLE_NAME].Columns.Add(ITM_HierarchyTable.DES_FLD);
                    dstBOMDetail.Tables[ITM_HierarchyTable.TABLE_NAME].Columns.Add(ITM_HierarchyTable.SOURCE_FLD);
                }
            }
            catch (PCSException ex)
            {
                throw new PCSException(ex.mCode, METHOD_NAME, ex);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
        }
        private bool GetDataFormGrid()
        {
            int intDeleteBefore = 0;
            for (int j = 0; j < dstBOMDetail.Tables[ITM_BOMTable.TABLE_NAME].Rows.Count; j++)
            {
                try
                {
                    if (dstBOMDetail.Tables[ITM_BOMTable.TABLE_NAME].Rows[j].RowState == DataRowState.Deleted)
                    {
                        dstBOMDetail.Tables[ITM_HierarchyTable.TABLE_NAME].Rows[j].Delete();
                        intDeleteBefore++;
                    }
                    else if ((dstBOMDetail.Tables[ITM_BOMTable.TABLE_NAME].Rows[j].RowState == DataRowState.Modified) || (dstBOMDetail.Tables[ITM_BOMTable.TABLE_NAME].Rows[j].RowState == DataRowState.Added))
                    {
                        dstBOMDetail.Tables[ITM_BOMTable.TABLE_NAME].Rows[j][ITM_BOMTable.PRODUCTID_FLD] = voProduct.ProductID;
                        dstBOMDetail.Tables[ITM_BOMTable.TABLE_NAME].Rows[j][ITM_BOMTable.COMPONENTID_FLD] = dgrdData[j - intDeleteBefore, ITM_BOMTable.COMPONENTID_FLD].ToString().Trim();
                        if (dgrdData[j - intDeleteBefore, ITM_BOMTable.ROUTINGID_FLD].ToString() != string.Empty)
                        {
                            try
                            {
                                dstBOMDetail.Tables[ITM_BOMTable.TABLE_NAME].Rows[j][ITM_BOMTable.ROUTINGID_FLD] = dgrdData.Columns[ITM_BOMTable.ROUTINGID_FLD].CellValue(j - intDeleteBefore);
                            }
                            catch
                            {
                                dstBOMDetail.Tables[ITM_BOMTable.TABLE_NAME].Rows[j][ITM_BOMTable.ROUTINGID_FLD] = DBNull.Value;
                            }
                        }
                    }
                    if (j - intDeleteBefore > dstBOMDetail.Tables[ITM_HierarchyTable.TABLE_NAME].Rows.Count - intDeleteBefore - 1)
                    {
                        DataRow drowHier = dstBOMDetail.Tables[ITM_HierarchyTable.TABLE_NAME].NewRow();

                        drowHier[ITM_HierarchyTable.SOURCE_FLD] = voProduct.ProductID;
                        drowHier[ITM_HierarchyTable.DES_FLD] = dgrdData[j - intDeleteBefore, ITM_BOMTable.COMPONENTID_FLD].ToString().Trim();
                        dstBOMDetail.Tables[ITM_HierarchyTable.TABLE_NAME].Rows.Add(drowHier);
                    }
                    else
                    {
                        if (dstBOMDetail.Tables[ITM_HierarchyTable.TABLE_NAME].Rows[j].RowState != DataRowState.Deleted)
                        {
                            dstBOMDetail.Tables[ITM_HierarchyTable.TABLE_NAME].Rows[j][ITM_HierarchyTable.SOURCE_FLD] = voProduct.ProductID;
                            dstBOMDetail.Tables[ITM_HierarchyTable.TABLE_NAME].Rows[j][ITM_HierarchyTable.DES_FLD] = dgrdData[j - intDeleteBefore, ITM_BOMTable.COMPONENTID_FLD].ToString().Trim();
                        }
                    }
                }
                catch
                { }
            }
            return true;
        }
        private void ConfigGridLayout()
        {
            const string METHOD_NAME = THIS + ".ConfigGridLayout()";
            try
            {
                //invisible columns
                dgrdData.Splits[0].DisplayColumns[ITM_BOMTable.BOMID_FLD].Visible = false;
                dgrdData.Splits[0].DisplayColumns[ITM_ProductTable.PRODUCTID_FLD].Visible = false;
                dgrdData.Splits[0].DisplayColumns[ITM_ProductTable.STOCKUMID_FLD].Visible = false;
                dgrdData.Splits[0].DisplayColumns[ITM_BOMTable.COMPONENTID_FLD].Visible = false;
                dgrdData.Splits[0].DisplayColumns[ITM_BOMTable.ROUTINGID_FLD].Visible = false;

                //lock columns
                dgrdData.Splits[0].DisplayColumns[CaptionLine].Locked = true;
                dgrdData.Splits[0].DisplayColumns[ITM_CategoryTable.TABLE_NAME + ITM_CategoryTable.CODE_FLD].Locked = true;
                dgrdData.Splits[0].DisplayColumns[MST_PartyTable.TABLE_NAME + MST_PartyTable.CODE_FLD].Locked = true;
                dgrdData.Splits[0].DisplayColumns[ITM_ProductTable.REVISION_FLD].Locked = true;
                dgrdData.Splits[0].DisplayColumns[StockUMCode].Locked = false;
                dgrdData.Splits[0].DisplayColumns[WorkCenterCode].Locked = true;

                //set new properties for columns
                dgrdData.Splits[0].DisplayColumns[ITM_ProductTable.CODE_FLD].Button = true;
                dgrdData.Splits[0].DisplayColumns[ITM_ProductTable.DESCRIPTION_FLD].Button = true;
                dgrdData.Splits[0].DisplayColumns[StockUMCode].Button = true;

                //set datetime control
                dgrdData.Splits[0].DisplayColumns[ITM_BOMTable.EFFECTIVEBEGINDATE_FLD].DataColumn.Editor = dtmEffectiveDate;
                dgrdData.Splits[0].DisplayColumns[ITM_BOMTable.EFFECTIVEENDDATE_FLD].DataColumn.Editor = dtmEffectiveDate;

                //set width for column
                dgrdData.Splits[0].DisplayColumns[CaptionLine].Style.HorizontalAlignment = AlignHorzEnum.Far;
                dgrdData.Splits[0].DisplayColumns[ITM_BOMTable.QUANTITY_FLD].Style.HorizontalAlignment = AlignHorzEnum.Far;
                dgrdData.Splits[0].DisplayColumns[ITM_BOMTable.ALTERNATIVE_FLD].Style.HorizontalAlignment = AlignHorzEnum.Far;
                dgrdData.Splits[0].DisplayColumns[ITM_BOMTable.LEADTIMEOFFSET_FLD].Style.HorizontalAlignment = AlignHorzEnum.Far;
                dgrdData.Splits[0].DisplayColumns[ITM_BOMTable.EFFECTIVEBEGINDATE_FLD].Style.HorizontalAlignment = AlignHorzEnum.Center;
                dgrdData.Splits[0].DisplayColumns[ITM_BOMTable.EFFECTIVEENDDATE_FLD].Style.HorizontalAlignment = AlignHorzEnum.Center;

                dgrdData.Splits[0].DisplayColumns[ITM_BOMTable.EFFECTIVEBEGINDAY_FLD].Style.HorizontalAlignment = AlignHorzEnum.Far;
                dgrdData.Splits[0].DisplayColumns[ITM_BOMTable.EFFECTIVEENDDAY_FLD].Style.HorizontalAlignment = AlignHorzEnum.Far;

                dgrdData.Splits[0].DisplayColumns[ITM_BOMTable.SHRINK_FLD].Style.HorizontalAlignment = AlignHorzEnum.Far;

                dgrdData.Columns[ITM_BOMTable.EFFECTIVEBEGINDATE_FLD].NumberFormat = Constants.DATETIME_FORMAT_HOUR;
                dgrdData.Columns[ITM_BOMTable.EFFECTIVEENDDATE_FLD].NumberFormat = Constants.DATETIME_FORMAT_HOUR;
                dgrdData.Columns[ITM_BOMTable.ALTERNATIVE_FLD].NumberFormat = Constants.INTERGER_NUMBERFORMAT;
                dgrdData.Columns[ITM_BOMTable.EFFECTIVEENDDAY_FLD].NumberFormat = Constants.INTERGER_NUMBERFORMAT;
                dgrdData.Columns[ITM_BOMTable.EFFECTIVEBEGINDAY_FLD].NumberFormat = Constants.INTERGER_NUMBERFORMAT;
                dgrdData.Columns[ITM_BOMTable.LEADTIMEOFFSET_FLD].NumberFormat = Constants.INTERGER_NUMBERFORMAT;
                dgrdData.Columns[ITM_BOMTable.QUANTITY_FLD].NumberFormat = DECIMAL_NUMBERFORMAT_SMALL;
                dgrdData.Columns[ITM_BOMTable.SHRINK_FLD].NumberFormat = DECIMAL_NUMBERFORMAT_SMALL;

                dgrdData.Splits[0].DisplayColumns[CaptionOperation].Button = true;
                for (int i = 0; i < dgrdData.Splits[0].DisplayColumns.Count; i++)
                {
                    dgrdData.Splits[0].DisplayColumns[i].HeadingStyle.HorizontalAlignment = AlignHorzEnum.Center;
                }
            }
            catch (PCSException ex)
            {
                throw new PCSException(ex.mCode, METHOD_NAME, ex);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
        }
        private void DisableGrid(bool blnSate)
        {
            for (int i = 0; i < dgrdData.Splits[0].DisplayColumns.Count; i++)
            {
                dgrdData.Splits[0].DisplayColumns[i].Locked = blnSate;
            }
        }
        private void Bom_Load(object sender, System.EventArgs e)
        {

            string METHOD_NAME = THIS + ".Bom_Load()";
            try
            {
                Security objSecurity = new Security();
                this.Name = THIS;
                if (objSecurity.SetRightForUserOnForm(this, SystemProperty.UserName) == 0)
                {
                    this.Close();
                    return;
                }

                LoadComboCCN();
                ResetForm();
                txtItemCode.Focus();

                dtbGridLayout = FormControlComponents.StoreGridLayout(dgrdData);
                dtmEffectiveDate.CustomFormat = Constants.DATETIME_FORMAT_HOUR;
                txtIncrement.Tag = OleDbType.TinyInt;

                //Reset form and load all ccn
                if (voProduct.ProductID == 0)
                {
                    EnableDisableButton(enumAction);

                    CreateTableForGrid(1);
                    dgrdData.DataSource = dstBOMDetail.Tables[ITM_BOMTable.TABLE_NAME];
                    FormControlComponents.RestoreGridLayout(dgrdData, dtbGridLayout);
                    ConfigGridLayout();
                }
                else
                {
                    voProduct = new ProductItemInfoBO().GetProductInfo(voProduct.ProductID);
                    txtItemCode.Text = voProduct.Code;
                    txtModel.Text = voProduct.Revision;
                    txtPartName.Text = voProduct.Description;
                    chkMakeItem.Checked = voProduct.MakeItem;
                    txtBOMDes.Text = voProduct.BOMDescription != null ? voProduct.BOMDescription : string.Empty;
                    if (voProduct.WorkCenterID != null)
                    {
                        int iWorkCenterID = voProduct.WorkCenterID ?? 0;
                        txtWorkCenter.Text = new BomBO().GetWorkCenterInfo(iWorkCenterID);
                    }
                    cboCCN.SelectedValue = voProduct.CCNID;
                    if (voProduct.BomIncrement != null && voProduct.BomIncrement != 0)
                    {
                        txtIncrement.Value = voProduct.BomIncrement.ToString();
                    }
                    CreateTableForGrid(2);
                    dstBOMDetail.Tables.Add(new BomBO().ListBOMDetailsOfProduct(voProduct.ProductID).Copy());
                    dstBOMDetail.Tables.Add(new BomBO().ListHierarchyOfProduct(voProduct.ProductID).Copy());
                    EnableDisableButton(enumAction);
                    intRowCountDelete = 0;
                    dgrdData.DataSource = dstBOMDetail.Tables[ITM_BOMTable.TABLE_NAME];

                    if (dstBOMDetail.Tables[ITM_BOMTable.TABLE_NAME].Rows.Count == 0)
                    {
                        enumAction = EnumAction.Add;
                        txtIncrement.Value = 1;
                        DisableGrid(false);
                        btnSave.Enabled = true;
                        txtBOMDes.Text = string.Empty;
                        txtIncrement.Enabled = true;
                        txtBOMDes.Enabled = true;
                        dgrdData.AllowDelete = true;
                    }
                    else
                    {
                        DisableGrid(true);
                        btnDelete.Enabled = true;
                        btnEdit.Enabled = true;
                        btnSave.Enabled = false;
                        txtBOMDes.Enabled = false;
                        txtIncrement.Enabled = false;
                    }
                    FormControlComponents.RestoreGridLayout(dgrdData, dtbGridLayout);
                    ConfigGridLayout();
                }
            }
            catch (PCSException ex)
            {
                PCSMessageBox.Show(ex.mCode, MessageBoxIcon.Error);
                try
                {
                    Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxIcon.Error);
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
                }
            }
        }
        private void EnableDisableButton(EnumAction enumAction)
        {
            if (enumAction == EnumAction.Default)
            {
                txtBOMDes.Enabled = false;
                txtIncrement.Enabled = false;
                DisableGrid(true);
                btnAdd.Enabled = true;
                btnSave.Enabled = false;
                btnFindItem.Enabled = true;
                btnEdit.Enabled = false;
                btnDelete.Enabled = false;
                dgrdData.AllowDelete = false;
            }
            if (enumAction == EnumAction.Add)
            {
                DisableGrid(false);
                btnSave.Enabled = true;
                btnAdd.Enabled = false;
                txtBOMDes.Enabled = true;
                txtIncrement.Enabled = true;
                btnEdit.Enabled = false;
                btnDelete.Enabled = false;
                dgrdData.AllowDelete = true;
                btnFindItem.Enabled = true;
            }
            if (enumAction == EnumAction.Edit)
            {
                DisableGrid(false);
                btnSave.Enabled = true;
                btnAdd.Enabled = false;
                btnDelete.Enabled = false;
                txtBOMDes.Enabled = true;
                txtIncrement.Enabled = true;
                dgrdData.AllowDelete = true;
                btnFindItem.Enabled = false;
            }
        }
        private void BindDataFromSearchFormToGrid(int pintProductID)
        {
            if (pintProductID != 0)
            {
                ITM_Product voComponent = new ITM_Product();
                MST_UnitOfMeasure voUM = new MST_UnitOfMeasure();

                voComponent =new ProductItemInfoBO().GetProductInfo(pintProductID);
                int iDesignUMID = voComponent.DesignUMID ?? 0;
                voUM = new UtilsBO().GetUnitOfMeasure(iDesignUMID);
                dgrdData.EditActive = true;
                dgrdData[dgrdData.Row, ITM_ProductTable.CODE_FLD] = voComponent.Code;
                dgrdData.Columns[ITM_ProductTable.CODE_FLD].Tag = voComponent.Code;
                dgrdData[dgrdData.Row, ITM_ProductTable.DESCRIPTION_FLD] = voComponent.Description;
                dgrdData[dgrdData.Row, ITM_ProductTable.REVISION_FLD] = voComponent.Revision;
                dgrdData[dgrdData.Row, ITM_BOMTable.COMPONENTID_FLD] = pintProductID;
                int iCostCenterID = voComponent.WorkCenterID ?? 0;
                dgrdData[dgrdData.Row, WorkCenterCode] = new BomBO().GetWorkCenterInfo(iCostCenterID);
                dgrdData[dgrdData.Row, StockUMCode] = voUM.Code;
                dgrdData[dgrdData.Row, ITM_BOMTable.BOMUMID_FLD] = voUM.UnitOfMeasureID;

                //get CategoryCode
                int iCategoryID = voComponent.CategoryID ?? 0;
                try
                {
                    ITM_Category voCategory = new ITM_CategoryBO().GetCategory(iCategoryID);
                    dgrdData[dgrdData.Row, ITM_CategoryTable.TABLE_NAME + ITM_CategoryTable.CODE_FLD] = voCategory.Code;
                }
                catch
                { }

                //get PartyCode
                //MST_Party voParty = new PartyBO().GetParty(voComponent.PrimaryVendorID, string.Empty);
                dgrdData[dgrdData.Row, MST_PartyTable.TABLE_NAME + MST_PartyTable.CODE_FLD] = "";

                int intIncrement = 0;
                if (dgrdData[dgrdData.Row, CaptionLine].ToString() == string.Empty)
                {
                    if (txtIncrement.Value.ToString() != string.Empty)
                    {
                        intIncrement = int.Parse(txtIncrement.Value.ToString());
                    }
                    if ((dgrdData.Row == 0) && (intIncrement > 0))
                    {
                        dgrdData[dgrdData.Row, CaptionLine] = intIncrement.ToString();
                    }
                    else if ((dgrdData.Row == 0) && (intIncrement == 0))
                    {
                        dgrdData[dgrdData.Row, CaptionLine] = 1;
                    }
                    else
                    {
                        try
                        {
                            intIncrement = dgrdData.Row;
                            if (intIncrement != 0)
                                dgrdData.Columns[CaptionLine].Value = int.Parse(dgrdData[dgrdData.Row - 1, CaptionLine].ToString()) + 1;
                            else
                                dgrdData.Columns[CaptionLine].Value = int.Parse(dgrdData[dgrdData.Row - 1, CaptionLine].ToString()) + 1;
                        }
                        catch
                        { }
                    }
                }
            }
            else
            {
                dgrdData[dgrdData.Row, ITM_ProductTable.CODE_FLD] = DBNull.Value;
                dgrdData[dgrdData.Row, ITM_ProductTable.DESCRIPTION_FLD] = DBNull.Value;
                dgrdData[dgrdData.Row, ITM_ProductTable.REVISION_FLD] = DBNull.Value;
                dgrdData[dgrdData.Row, ITM_BOMTable.COMPONENTID_FLD] = DBNull.Value;
                dgrdData[dgrdData.Row, StockUMCode] = DBNull.Value;
                dgrdData[dgrdData.Row, ITM_BOMTable.BOMUMID_FLD] = DBNull.Value;
                dgrdData[dgrdData.Row, WorkCenterCode] = DBNull.Value;
                dgrdData[dgrdData.Row, ITM_CategoryTable.TABLE_NAME + ITM_CategoryTable.CODE_FLD] = DBNull.Value;
                dgrdData[dgrdData.Row, MST_PartyTable.TABLE_NAME + MST_PartyTable.CODE_FLD] = DBNull.Value;
            }
        }

        private void dgrdData_ButtonClick(object sender, C1.Win.C1TrueDBGrid.ColEventArgs e)
        {
            const string METHOD_NAME = THIS + ".dgrdData_ButtonClick()";
            string strColName = dgrdData.Splits[0].DisplayColumns[dgrdData.Col].DataColumn.DataField;
            Hashtable htbCondition = new Hashtable();
            if (!btnSave.Enabled) return;
            DataRowView drwResult = null;
            try
            {
                if ((strColName == ITM_ProductTable.CODE_FLD) && (!dgrdData.Splits[0].DisplayColumns[strColName].Locked))
                {
                    if (cboCCN.SelectedValue != null)
                        htbCondition.Add(ITM_ProductTable.CCNID_FLD, cboCCN.SelectedValue.ToString());
                    else
                        htbCondition.Add(ITM_ProductTable.CCNID_FLD, 0);
                    if (dgrdData.AddNewMode == AddNewModeEnum.AddNewCurrent)
                        drwResult = FormControlComponents.OpenSearchForm(v_ITMBOM_Product.VIEW_NAME, ITM_ProductTable.CODE_FLD, dgrdData[dgrdData.Row, strColName].ToString(), htbCondition, true);
                    else
                        drwResult = FormControlComponents.OpenSearchForm(v_ITMBOM_Product.VIEW_NAME, ITM_ProductTable.CODE_FLD, dgrdData.Columns[strColName].Text.Trim(), htbCondition, true);
                    if (drwResult != null)
                        BindDataFromSearchFormToGrid(int.Parse(drwResult[ITM_ProductTable.PRODUCTID_FLD].ToString()));
                }
                if ((strColName == ITM_ProductTable.DESCRIPTION_FLD) && (!dgrdData.Splits[0].DisplayColumns[strColName].Locked))
                {
                    if (cboCCN.SelectedValue != null)
                    {
                        htbCondition.Add(ITM_ProductTable.CCNID_FLD, cboCCN.SelectedValue.ToString());
                    }
                    else
                    {
                        htbCondition.Add(ITM_ProductTable.CCNID_FLD, 0);
                    }
                    if (dgrdData.AddNewMode == AddNewModeEnum.AddNewCurrent)
                    {
                        drwResult = FormControlComponents.OpenSearchForm(v_ITMBOM_Product.VIEW_NAME, ITM_ProductTable.DESCRIPTION_FLD, dgrdData[dgrdData.Row, strColName].ToString(), htbCondition, true);
                    }
                    else
                    {
                        drwResult = FormControlComponents.OpenSearchForm(v_ITMBOM_Product.VIEW_NAME, ITM_ProductTable.DESCRIPTION_FLD, dgrdData.Columns[strColName].Text.Trim(), htbCondition, true);
                    }
                    if (drwResult != null)
                    {
                        BindDataFromSearchFormToGrid(int.Parse(drwResult[ITM_ProductTable.PRODUCTID_FLD].ToString()));
                    }
                }
                if (strColName == CaptionOperation)
                {
                    htbCondition = new Hashtable();
                    htbCondition.Add(ITM_ProductTable.PRODUCTID_FLD, voProduct.ProductID);
                    if (dgrdData.AddNewMode != AddNewModeEnum.NoAddNew)
                    {
                        drwResult = FormControlComponents.OpenSearchForm(ITM_RoutingTable.TABLE_NAME, ITM_RoutingTable.STEP_FLD, dgrdData[dgrdData.Row, strColName].ToString(), htbCondition, true);
                    }
                    else
                    {
                        drwResult = FormControlComponents.OpenSearchForm(ITM_RoutingTable.TABLE_NAME, ITM_RoutingTable.STEP_FLD, dgrdData.Columns[strColName].Text.Trim(), htbCondition, true);
                    }
                    if (drwResult != null)
                    {
                        dgrdData.Columns[ITM_BOMTable.ROUTINGID_FLD].Value = drwResult[ITM_RoutingTable.ROUTINGID_FLD];
                        dgrdData.Columns[CaptionOperation].Value = drwResult[ITM_RoutingTable.STEP_FLD].ToString();
                    }
                }
                if ((strColName == ITM_ProductTable.STOCK_FLD.Trim() + MST_UnitOfMeasureTable.CODE_FLD.Trim()) && (!dgrdData.Splits[0].DisplayColumns[strColName].Locked))
                {
                    drwResult = FormControlComponents.OpenSearchForm(MST_UnitOfMeasureTable.TABLE_NAME, MST_UnitOfMeasureTable.CODE_FLD, dgrdData[dgrdData.Row, strColName].ToString(), htbCondition, true);

                    if (drwResult != null)
                    {
                        dgrdData[dgrdData.Row, StockUMCode] = drwResult[MST_UnitOfMeasureTable.CODE_FLD];
                        dgrdData[dgrdData.Row, ITM_BOMTable.BOMUMID_FLD] = drwResult[MST_UnitOfMeasureTable.UNITOFMEASUREID_FLD];
                    }
                }
            }
            catch (PCSException ex)
            {
                PCSMessageBox.Show(ex.mCode, MessageBoxIcon.Error);
                try
                {
                    Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxIcon.Error);
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
                }
            }
        }
        private bool ValidateData()
        {
            //requires
            if (FormControlComponents.CheckMandatory(txtItemCode))
            {
                PCSMessageBox.Show(ErrorCode.MANDATORY_INVALID);
                txtItemCode.Focus();
                txtItemCode.Select();
                return false;
            }

            if (txtIncrement.Value.ToString().Trim() != string.Empty)
            {
                if (!FormControlComponents.IsNumeric(txtIncrement.Value.ToString()))
                {
                    PCSMessageBox.Show(ErrorCode.MESSAGE_INVALID_NUMERIC);
                    txtIncrement.Focus();
                    txtIncrement.Select();
                    return false;
                }
                voProduct.BomIncrement = byte.Parse(txtIncrement.Value.ToString().Trim());
                if ((voProduct.BomIncrement > 255) || (voProduct.BomIncrement < 0))
                {
                    PCSMessageBox.Show(ErrorCode.MESSAGE_INVALID_NUMERIC);
                }
            }

            if (dgrdData.RowCount == 0)
            {
                PCSMessageBox.Show(ErrorCode.MESSAGE_BOM_EXISTATLISTROW);
            }

            //validate on grid
            dgrdData.UpdateData();
            for (int i = 0; i < dgrdData.RowCount; i++)
            {
                //check all component
                if (dgrdData[i, ITM_ProductTable.CODE_FLD].ToString() == string.Empty)
                {
                    PCSMessageBox.Show(ErrorCode.MANDATORY_INVALID, MessageBoxIcon.Warning);
                    dgrdData.Row = i;
                    dgrdData.Col = dgrdData.Splits[0].DisplayColumns.IndexOf(dgrdData.Splits[0].DisplayColumns[ITM_ProductTable.CODE_FLD]);
                    dgrdData.Focus();
                    return false;
                }
                if (dgrdData[i, ITM_BOMTable.QUANTITY_FLD].ToString().Trim() == string.Empty)
                {
                    PCSMessageBox.Show(ErrorCode.MANDATORY_INVALID, MessageBoxIcon.Warning);
                    dgrdData.Row = i;
                    dgrdData.Col = dgrdData.Splits[0].DisplayColumns.IndexOf(dgrdData.Splits[0].DisplayColumns[ITM_BOMTable.QUANTITY_FLD]);
                    dgrdData.Focus();
                    return false;
                }
                //check shrink
                try
                {
                    if (dgrdData[i, ITM_BOMTable.SHRINK_FLD].ToString().Trim() != string.Empty)
                    {
                        float intShrink = float.Parse(dgrdData[i, ITM_BOMTable.SHRINK_FLD].ToString().Trim());
                        if ((intShrink < 0) && (intShrink > 100))
                        {
                            PCSMessageBox.Show(ErrorCode.MESSAGE_BOM_SHRINK);
                            dgrdData.Row = i;
                            dgrdData.Col = dgrdData.Splits[0].DisplayColumns.IndexOf(dgrdData.Splits[0].DisplayColumns[ITM_BOMTable.SHRINK_FLD]);
                            dgrdData.Focus();
                            return false;
                        }
                    }
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.MESSAGE_BOM_SHRINK);
                    dgrdData.Row = i;
                    dgrdData.Col = dgrdData.Splits[0].DisplayColumns.IndexOf(dgrdData.Splits[0].DisplayColumns[ITM_BOMTable.SHRINK_FLD]);
                    dgrdData.Focus();
                    return false;
                }

                for (int j = i + 1; j < dgrdData.RowCount; j++)
                {
                    try
                    {
                        if (dgrdData[i, ITM_ProductTable.CODE_FLD].ToString() != string.Empty && dgrdData[j, ITM_ProductTable.CODE_FLD].ToString()!=string.Empty)
                        {
                            if (dgrdData[i, ITM_ProductTable.CODE_FLD].ToString() == dgrdData[j, ITM_ProductTable.CODE_FLD].ToString())
                            {
                                PCSMessageBox.Show("Mã VT bị trùng");
                                dgrdData.Row = j;
                                dgrdData.Col = dgrdData.Splits[0].DisplayColumns.IndexOf(dgrdData.Splits[0].DisplayColumns[ITM_ProductTable.CODE_FLD]);
                                dgrdData.Focus();
                                return false;
                            }
                        }
                    }
                    catch
                    { 
                    }
                }
            }
            
            return true;
        }

        private void btnSave_Click(object sender, System.EventArgs e)
        {
            const string METHOD_NAME = THIS + ".btnSave_Click()";
            blnHasError = true;
            try
            {
                if (!dgrdData.EditActive && ValidateData())
                {
                    if (!GetDataFormGrid()) return;
                    voProduct.BOMDescription = txtBOMDes.Text.Trim();                    
                    BomBO boBOM = new BomBO();
                    List<ITM_BOM> listBOM = new List<ITM_BOM>();
                    if (dstBOMDetail.Tables[ITM_BOMTable.TABLE_NAME].Rows.Count > 0)
                        foreach (DataRow dr in dstBOMDetail.Tables[ITM_BOMTable.TABLE_NAME].Rows)
                        {
                            try
                            {
                                ITM_BOM objBOM = new ITM_BOM();
                                if (dr[ITM_BOMTable.ALTERNATIVE_FLD] != null && !string.IsNullOrEmpty(dr[ITM_BOMTable.ALTERNATIVE_FLD].ToString()))
                                    objBOM.Alternative = Convert.ToInt32(dr[ITM_BOMTable.ALTERNATIVE_FLD].ToString());
                                if (dr[ITM_BOMTable.BOMUMID_FLD] != null && !string.IsNullOrEmpty(dr[ITM_BOMTable.BOMUMID_FLD].ToString()))
                                    objBOM.BomUMID = Convert.ToInt32(dr[ITM_BOMTable.BOMUMID_FLD].ToString());
                                objBOM.ComponentID = Convert.ToInt32(dr[ITM_BOMTable.COMPONENTID_FLD].ToString());
                                if (dr[ITM_BOMTable.EFFECTIVEBEGINDATE_FLD] != null && !string.IsNullOrEmpty(dr[ITM_BOMTable.EFFECTIVEBEGINDATE_FLD].ToString()))
                                    objBOM.EffectiveBeginDate = Convert.ToDateTime(dr[ITM_BOMTable.EFFECTIVEBEGINDATE_FLD].ToString());
                                if (dr[ITM_BOMTable.EFFECTIVEBEGINDAY_FLD] != null && !string.IsNullOrEmpty(dr[ITM_BOMTable.EFFECTIVEBEGINDAY_FLD].ToString()))
                                    objBOM.EffectiveBeginDay = Convert.ToByte(dr[ITM_BOMTable.EFFECTIVEBEGINDAY_FLD].ToString());
                                if (dr[ITM_BOMTable.EFFECTIVEENDDATE_FLD] != null && !string.IsNullOrEmpty(dr[ITM_BOMTable.EFFECTIVEENDDATE_FLD].ToString()))
                                    objBOM.EffectiveEndDate = Convert.ToDateTime(dr[ITM_BOMTable.EFFECTIVEENDDATE_FLD].ToString());
                                if (dr[ITM_BOMTable.EFFECTIVEENDDAY_FLD] != null && !string.IsNullOrEmpty(dr[ITM_BOMTable.EFFECTIVEENDDAY_FLD].ToString()))
                                    objBOM.EffectiveEndDay = Convert.ToByte(dr[ITM_BOMTable.EFFECTIVEENDDAY_FLD].ToString());
                                if (dr[ITM_BOMTable.LEADTIMEOFFSET_FLD] != null && !string.IsNullOrEmpty(dr[ITM_BOMTable.LEADTIMEOFFSET_FLD].ToString()))
                                    objBOM.LeadTimeOffset = Convert.ToDecimal(dr[ITM_BOMTable.LEADTIMEOFFSET_FLD].ToString());
                                if (dr[ITM_BOMTable.LINE_FLD] != null && !string.IsNullOrEmpty(dr[ITM_BOMTable.LINE_FLD].ToString()))
                                    objBOM.Line = Convert.ToInt32(dr[ITM_BOMTable.LINE_FLD].ToString());
                                objBOM.ProductID = Convert.ToInt32(dr[ITM_BOMTable.PRODUCTID_FLD].ToString());
                                if (dr[ITM_BOMTable.QUANTITY_FLD] != null && !string.IsNullOrEmpty(dr[ITM_BOMTable.QUANTITY_FLD].ToString()))
                                    objBOM.Quantity = Convert.ToDecimal(dr[ITM_BOMTable.QUANTITY_FLD].ToString());
                                if (dr[ITM_BOMTable.ROUTINGID_FLD] != null && !string.IsNullOrEmpty(dr[ITM_BOMTable.ROUTINGID_FLD].ToString()))
                                    objBOM.RoutingID = Convert.ToInt32(dr[ITM_BOMTable.ROUTINGID_FLD].ToString());
                                if (dr[ITM_BOMTable.SHRINK_FLD] != null && !string.IsNullOrEmpty(dr[ITM_BOMTable.SHRINK_FLD].ToString()))
                                    objBOM.Shrink = Convert.ToDecimal(dr[ITM_BOMTable.SHRINK_FLD].ToString());
                                listBOM.Add(objBOM);
                            }
                            catch
                            { }
                        }
                    List<ITM_Hierarchy> listHierarchy = new List<ITM_Hierarchy>();
                    if (dstBOMDetail.Tables[ITM_HierarchyTable.TABLE_NAME].Rows.Count > 0)
                        foreach (DataRow dr in dstBOMDetail.Tables[ITM_HierarchyTable.TABLE_NAME].Rows)
                        {
                            try
                            {
                                ITM_Hierarchy objHierachy = new ITM_Hierarchy();
                                if (dr[ITM_HierarchyTable.DES_FLD] != null && !string.IsNullOrEmpty(dr[ITM_HierarchyTable.DES_FLD].ToString()))
                                    objHierachy.Destination = Convert.ToInt32(dr[ITM_HierarchyTable.DES_FLD].ToString());
                                if (dr[ITM_HierarchyTable.SOURCE_FLD] != null && !string.IsNullOrEmpty(dr[ITM_HierarchyTable.SOURCE_FLD].ToString()))
                                    objHierachy.Source = Convert.ToInt32(dr[ITM_HierarchyTable.DES_FLD].ToString());
                                listHierarchy.Add(objHierachy);
                            }
                            catch
                            { }
                        }
                    //Update
                    boBOM.UpdateBOM(listBOM, listHierarchy, voProduct);

                    CreateTableForGrid(2);
                    dstBOMDetail.Tables.Add(new BomBO().ListBOMDetailsOfProduct(voProduct.ProductID).Copy());
                    dstBOMDetail.Tables.Add(new BomBO().ListHierarchyOfProduct(voProduct.ProductID).Copy());
                    intRowCountDelete = 0;
                    dgrdData.DataSource = dstBOMDetail.Tables[ITM_BOMTable.TABLE_NAME];
                    ConfigGridLayout();
                    FormControlComponents.RestoreGridLayout(dgrdData, dtbGridLayout);
                    PCSMessageBox.Show(ErrorCode.MESSAGE_AFTER_SAVE_DATA);
                    blnHasError = false;
                    btnSave.Enabled = false;
                    DisableGrid(true);
                    btnEdit.Enabled = true;
                    btnDelete.Enabled = true;
                    btnAdd.Enabled = true;
                    dgrdData.AllowDelete = false;
                    enumAction = EnumAction.Default;
                    txtBOMDes.Enabled = false;
                    txtIncrement.Enabled = false;
                }
            }
            catch (PCSException ex)
            {
                if (ex.mCode == ErrorCode.DUPLICATE_KEY)
                {
                    PCSMessageBox.Show(ErrorCode.MESSAGE_BOM_DUPLICATECOMPONENT, MessageBoxIcon.Error);
                }
                else
                {
                    PCSMessageBox.Show(ex.mCode, MessageBoxIcon.Error);
                }
                if (ex.CauseException != null)
                {
                    try
                    {
                        Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
                    }
                    catch
                    {
                        PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
                    }
                }
            }
            catch (Exception ex)
            {
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxIcon.Error);
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
                }
            }
        }
        private void btnDelete_Click(object sender, System.EventArgs e)
        {
            const string METHOD_NAME = THIS + ".btnDelete_Click()";
            try
            {
                if (dgrdData.EditActive) return;
                DataSet dstDelete = new DataSet();
                dstDelete.Tables.Add(new BomBO().ListBOMDetailsOfProduct(voProduct.ProductID).Copy());
                dstDelete.Tables.Add(new BomBO().ListHierarchyOfProduct(voProduct.ProductID).Copy());
                if (PCSMessageBox.Show(ErrorCode.MESSAGE_DELETE_RECORD, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    foreach (DataRow drow in dstDelete.Tables[ITM_BOMTable.TABLE_NAME].Rows)
                    {
                        drow.Delete();
                    }
                    foreach (DataRow drow in dstDelete.Tables[ITM_HierarchyTable.TABLE_NAME].Rows)
                    {
                        drow.Delete();
                    }
                    BomBO boBOM = new BomBO();
                    voProduct.BOMDescription = string.Empty;
                    voProduct.BomIncrement = 0;
                    boBOM.UpdateAll(dstDelete, voProduct);
                    dgrdData.DataSource = dstDelete.Tables[0];
                    FormControlComponents.RestoreGridLayout(dgrdData, dtbGridLayout);
                    ConfigGridLayout();
                    ResetForm();
                    enumAction = EnumAction.Default;
                    EnableDisableButton(enumAction);
                    btnAdd.Focus();
                }
            }
            catch (PCSException ex)
            {
                PCSMessageBox.Show(ex.mCode, MessageBoxIcon.Error);
                try
                {
                    Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxIcon.Error);
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
                }
            }
        }
        private void btnAdd_Click(object sender, System.EventArgs e)
        {
            const string METHOD_NAME = THIS + ".btnAdd_Click()";
            try
            {
                ResetForm();
                CreateTableForGrid(1);
                dgrdData.DataSource = dstBOMDetail.Tables[ITM_BOMTable.TABLE_NAME];
                FormControlComponents.RestoreGridLayout(dgrdData, dtbGridLayout);
                ConfigGridLayout();
                enumAction = EnumAction.Add;
                EnableDisableButton(enumAction);
                txtIncrement.Value = 1.ToString();
            }
            catch (PCSException ex)
            {
                throw new PCSException(ex.mCode, METHOD_NAME, ex);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
        }

        private void txtItemCode_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
        {
            if (e.KeyCode == Keys.F4)
            {
                btnFindItem_Click(sender, new EventArgs());
            }
        }

        private void btnEdit_Click(object sender, System.EventArgs e)
        {
            const string METHOD_NAME = THIS + ".btnEdit_Click()";
            try
            {
                enumAction = EnumAction.Edit;
                EnableDisableButton(enumAction);
                txtIncrement.Focus();
                btnEdit.Enabled = false;
                btnAdd.Enabled = false;
                ConfigGridLayout();
            }
            catch (PCSException ex)
            {
                throw new PCSException(ex.mCode, METHOD_NAME, ex);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
        }

        private void btnOK_Click(object sender, System.EventArgs e)
        {
            this.Close();
        }

        private void Bom_Closing(object sender, System.ComponentModel.CancelEventArgs e)
        {
            const string METHOD_NAME = THIS + ".SOPackListManagement_Closing()";
            try
            {
                if ((enumAction == EnumAction.Add) || (enumAction == EnumAction.Edit))
                {
                    DialogResult confirmDialog = PCSMessageBox.Show(ErrorCode.MESSAGE_QUESTION_STORE_INTO_DATABASE, MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);
                    switch (confirmDialog)
                    {
                        case DialogResult.Yes:
                            //Save before exit
                            btnSave_Click(btnSave, new EventArgs());
                            if (blnHasError)
                            {
                                e.Cancel = true;
                            }
                            break;
                        case DialogResult.No:
                            break;
                        case DialogResult.Cancel:
                            e.Cancel = true;
                            break;
                    }
                }
            }
            catch (Exception ex)
            {
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxIcon.Error);
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
                }
            }
        }
        private void CheckDateOntheGrid(int intRowIndex, C1.Win.C1TrueDBGrid.BeforeColUpdateEventArgs e)
        {
            DateTime dtmBegin = new DateTime(), dtmEnd = new DateTime();
            if (e.Column.DataColumn.DataField == ITM_BOMTable.EFFECTIVEENDDATE_FLD)
            {
                if (dgrdData[intRowIndex, ITM_BOMTable.EFFECTIVEBEGINDATE_FLD].ToString().Trim() != string.Empty)
                {
                    dtmBegin = DateTime.Parse(dgrdData[intRowIndex, ITM_BOMTable.EFFECTIVEBEGINDATE_FLD].ToString().Trim());
                }
                if (e.Column.DataColumn.Value.ToString() != string.Empty)
                {
                    dtmEnd = DateTime.Parse(e.Column.DataColumn.Value.ToString());
                }
                if ((dgrdData[intRowIndex, ITM_BOMTable.EFFECTIVEBEGINDATE_FLD].ToString().Trim() != string.Empty) && (e.Column.DataColumn.Value.ToString() != string.Empty))
                    if (dtmBegin > dtmEnd)
                    {
                        throw new PCSException(ErrorCode.MESSAGE_COSTCENTERRATE_CHECKDATEONEROW, string.Empty, null);
                    }
                if (dgrdData.RowCount > 1)
                {
                    if (intRowIndex < dgrdData.RowCount - 2)
                    {
                        if (e.Column.DataColumn.Value.ToString() != string.Empty)
                        {
                            DateTime dtmEndPrevious = DateTime.Parse(e.Column.DataColumn.Value.ToString());
                            if (dgrdData[intRowIndex + 1, ITM_BOMTable.EFFECTIVEBEGINDATE_FLD].ToString() != string.Empty)
                            {
                                dtmBegin = DateTime.Parse(dgrdData[intRowIndex + 1, ITM_BOMTable.EFFECTIVEBEGINDATE_FLD].ToString());
                                if (dtmBegin < dtmEndPrevious)
                                {
                                    throw new PCSException(ErrorCode.MESSAGE_COSTCENTERRATE_CHECKDATEEVERYROW, string.Empty, null);
                                }
                            }
                        }
                    }
                }
            }
            if (e.Column.DataColumn.DataField == ITM_BOMTable.EFFECTIVEBEGINDATE_FLD)
            {
                if (e.Column.DataColumn.Value.ToString() != string.Empty)
                {
                    dtmBegin = DateTime.Parse(e.Column.DataColumn.Value.ToString());
                }
                if (dgrdData[intRowIndex, ITM_BOMTable.EFFECTIVEENDDATE_FLD].ToString().Trim() != string.Empty)
                {
                    dtmEnd = DateTime.Parse(dgrdData[intRowIndex, ITM_BOMTable.EFFECTIVEENDDATE_FLD].ToString().Trim());
                }
                if ((e.Column.DataColumn.Value.ToString() != string.Empty) && (dgrdData[intRowIndex, ITM_BOMTable.EFFECTIVEENDDATE_FLD].ToString().Trim() != string.Empty))
                    if (dtmBegin > dtmEnd)
                    {
                        throw new PCSException(ErrorCode.MESSAGE_COSTCENTERRATE_CHECKDATEONEROW, string.Empty, null);
                    }
                if (dgrdData.RowCount > 1)
                {
                    if (intRowIndex > 0)
                    {
                        if (dgrdData[intRowIndex - 1, ITM_BOMTable.EFFECTIVEBEGINDATE_FLD].ToString().Trim() != string.Empty)
                        {
                            DateTime dtmEndPrevious = DateTime.Parse(dgrdData[intRowIndex - 1, ITM_BOMTable.EFFECTIVEBEGINDATE_FLD].ToString().Trim());
                            if (dgrdData[intRowIndex - 1, ITM_BOMTable.EFFECTIVEBEGINDATE_FLD].ToString() != string.Empty)
                            {
                                dtmBegin = DateTime.Parse(e.Column.DataColumn.Value.ToString());
                                if (dtmBegin < dtmEndPrevious)
                                {
                                    throw new PCSException(ErrorCode.MESSAGE_COSTCENTERRATE_CHECKDATEEVERYROW, string.Empty, null);
                                }
                            }
                        }
                    }
                }
            }
        }

        private void dgrdData_BeforeColUpdate(object sender, C1.Win.C1TrueDBGrid.BeforeColUpdateEventArgs e)
        {
            const string METHOD_NAME = THIS + ".dgrdData_BeforeColUpdate()";
            try
            {
                Hashtable htbCriteria = new Hashtable();
                DataRowView drwResult = null;
                if (e.Column.DataColumn.Text.Trim() == string.Empty) return;
                if (e.Column.DataColumn.DataField == ITM_ProductTable.CODE_FLD || e.Column.DataColumn.DataField == ITM_ProductTable.DESCRIPTION_FLD)
                {
                    if (cboCCN.SelectedIndex >= 0)
                    {
                        htbCriteria.Add(MST_CCNTable.CCNID_FLD, cboCCN.SelectedValue.ToString());
                    }
                    else
                    {
                        htbCriteria.Add(MST_CCNTable.CCNID_FLD, 0);
                    }
                    drwResult = FormControlComponents.OpenSearchForm(v_ITMBOM_Product.VIEW_NAME, e.Column.DataColumn.DataField, dgrdData.Columns[e.Column.DataColumn.DataField].Text.Trim(), htbCriteria, false);
                    if (drwResult != null)
                    {
                        e.Column.DataColumn.Tag = drwResult.Row;
                    }
                    else
                    {
                        e.Cancel = true;
                    }
                }
                if (e.Column.DataColumn.DataField == CaptionOperation)
                {
                    htbCriteria = new Hashtable();
                    htbCriteria.Add(ITM_ProductTable.PRODUCTID_FLD, voProduct.ProductID);
                    drwResult = FormControlComponents.OpenSearchForm(ITM_RoutingTable.TABLE_NAME, ITM_RoutingTable.STEP_FLD, dgrdData.Columns[e.Column.DataColumn.DataField].Text.Trim(), htbCriteria, false);
                    if (drwResult != null)
                    {
                        dgrdData.Columns[ITM_RoutingTable.ROUTINGID_FLD].Value = int.Parse(drwResult[ITM_RoutingTable.ROUTINGID_FLD].ToString());
                        dgrdData.Columns[CaptionOperation].Value = drwResult[ITM_RoutingTable.STEP_FLD];
                        e.Column.DataColumn.Tag = drwResult.Row;
                    }
                    else
                    {
                        e.Cancel = true;
                    }
                }
                //check quantity
                if (dgrdData.Splits[0].DisplayColumns[dgrdData.Col].DataColumn.DataField == ITM_BOMTable.QUANTITY_FLD)
                {
                    try
                    {
                        float fQuantity = float.Parse(dgrdData.Splits[0].DisplayColumns[ITM_BOMTable.QUANTITY_FLD].DataColumn.Value.ToString().Trim());
                        if (fQuantity <= 0.0)
                        {
                            PCSMessageBox.Show(ErrorCode.MESSAGE_BOM_QUANTITY, MessageBoxIcon.Error);
                            e.Cancel = true;
                            return;
                        }
                    }
                    catch
                    {
                        //cancel update and throw PCSException
                        e.Cancel = true;
                        PCSMessageBox.Show(ErrorCode.MESSAGE_BOM_QUANTITY, MessageBoxIcon.Error);
                        return;
                    }
                }
                //check shrink
                if (e.Column.DataColumn.DataField == ITM_BOMTable.SHRINK_FLD)
                {
                    try
                    {
                        if (e.Column.DataColumn.Value.ToString() != string.Empty)
                        {
                            decimal intShrink = decimal.Parse(e.Column.DataColumn.Value.ToString());
                            if ((intShrink < 0) || (intShrink > 99))
                            {
                                PCSMessageBox.Show(ErrorCode.MESSAGE_BOM_SHRINK, MessageBoxIcon.Error);
                                e.Cancel = true;
                                return;
                            }
                        }
                    }
                    catch
                    {
                        PCSMessageBox.Show(ErrorCode.MESSAGE_BOM_SHRINK, MessageBoxIcon.Error);
                        e.Cancel = true;
                        return;
                    }
                }

                //check lead time offset
                if (e.Column.DataColumn.DataField == ITM_BOMTable.LEADTIMEOFFSET_FLD)
                {
                    try
                    {
                        if (e.Column.DataColumn.Value.ToString() != string.Empty)
                        {
                            decimal intLeadTime = decimal.Parse(e.Column.DataColumn.Value.ToString());
                            if (intLeadTime <= 0)
                            {
                                PCSMessageBox.Show(ErrorCode.MSG_LABORTIME_QTY, MessageBoxIcon.Error);
                                e.Cancel = true;
                                return;
                            }
                        }
                    }
                    catch
                    {
                        PCSMessageBox.Show(ErrorCode.MSG_LABORTIME_QTY, MessageBoxIcon.Error);
                        e.Cancel = true;
                        return;
                    }
                }
                CheckDateOntheGrid(dgrdData.Row, e);
                //check allternative
                if (e.Column.DataColumn.DataField == ITM_BOMTable.ALTERNATIVE_FLD ||
                    e.Column.DataColumn.DataField == ITM_BOMTable.EFFECTIVEBEGINDAY_FLD ||
                    e.Column.DataColumn.DataField == ITM_BOMTable.EFFECTIVEENDDAY_FLD)
                {
                    try
                    {
                        int intValue = int.Parse(e.Column.DataColumn.Value.ToString());
                        if (intValue < 0)
                        {
                            PCSMessageBox.Show(ErrorCode.MSG_LABORTIME_QTY, MessageBoxIcon.Error);
                            e.Cancel = true;
                            return;
                        }
                    }
                    catch
                    {
                        PCSMessageBox.Show(ErrorCode.MSG_LABORTIME_QTY, MessageBoxIcon.Error);
                        e.Cancel = true;
                        return;
                    }
                }

                //check begin eff day
                if (e.Column.DataColumn.DataField == ITM_BOMTable.EFFECTIVEBEGINDAY_FLD)
                {
                    if ((e.Column.DataColumn.Value.ToString() != string.Empty) && (dgrdData[dgrdData.Row, ITM_BOMTable.EFFECTIVEENDDAY_FLD].ToString() != string.Empty))
                    {
                        int intBegin = int.Parse(e.Column.DataColumn.Value.ToString());
                        int intEnd = int.Parse(dgrdData[dgrdData.Row, ITM_BOMTable.EFFECTIVEENDDAY_FLD].ToString());
                        if (intBegin > intEnd)
                        {
                            PCSMessageBox.Show(ErrorCode.MESSAGE_BOM_BEGIN_END_DAY, MessageBoxIcon.Error);
                            e.Cancel = true;
                            return;
                        }
                    }
                }

                //check end eff day
                if (e.Column.DataColumn.DataField == ITM_BOMTable.EFFECTIVEENDDAY_FLD)
                {
                    if ((e.Column.DataColumn.Value.ToString() != string.Empty) && (dgrdData[dgrdData.Row, ITM_BOMTable.EFFECTIVEBEGINDAY_FLD].ToString() != string.Empty))
                    {
                        int intEnd = int.Parse(e.Column.DataColumn.Value.ToString());
                        int intBegin = int.Parse(dgrdData[dgrdData.Row, ITM_BOMTable.EFFECTIVEBEGINDAY_FLD].ToString());
                        if (intBegin > intEnd)
                        {
                            PCSMessageBox.Show(ErrorCode.MESSAGE_BOM_BEGIN_END_DAY, MessageBoxIcon.Error);
                            e.Cancel = true;
                            return;
                        }
                    }
                }
            }
            catch (PCSException ex)
            {
                PCSMessageBox.Show(ex.mCode, MessageBoxIcon.Error);
                e.Cancel = true;
                try
                {
                    Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
                }
                return;
            }
            catch (Exception ex)
            {
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxIcon.Error);
                e.Cancel = true;
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
                }
                return;
            }
        }

        private void cboCCN_TextChanged(object sender, System.EventArgs e)
        {
            ResetForm();
            EnableDisableButton(enumAction);
        }

        private void Bom_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
        {
            if (e.KeyCode == Keys.F12)
            {
                if (btnSave.Enabled)
                {
                    dgrdData.Row = dgrdData.RowCount - 1;
                    dgrdData.Col = dgrdData.Columns.IndexOf(dgrdData.Columns[ITM_ProductTable.CODE_FLD]);
                    dgrdData.Focus();
                }
            }
        }
        private void dgrdData_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
        {
            switch (e.KeyCode)
            {
                case Keys.F4:
                    if (btnSave.Enabled)
                    {
                        dgrdData_ButtonClick(sender, null);
                    }
                    break;

            }
        }

        #region Change backcolor when focus or lost focus
        private void OnEnterControl(object sender, System.EventArgs e)
        {
            const string METHOD_NAME = THIS + ". OnEnterControl()";
            try
            {
                FormControlComponents.OnEnterControl(sender, e);
            }
            catch (Exception ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }

        private void OnLeaveControl(object sender, System.EventArgs e)
        {
            const string METHOD_NAME = THIS + ". OnLeaveControl()";
            try
            {
                FormControlComponents.OnLeaveControl(sender, e);
                //				CheckScopeOfControl(sender);
            }
            catch (Exception ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
        #endregion

        private void dgrdData_AfterColUpdate(object sender, C1.Win.C1TrueDBGrid.ColEventArgs e)
        {
            const string METHOD_NAME = THIS + ".dgrdData_AfterColUpdate()";
            try
            {
                string ColName = e.Column.DataColumn.DataField;
                if (ColName == ITM_ProductTable.CODE_FLD || ColName == ITM_ProductTable.DESCRIPTION_FLD)
                {
                    if (e.Column.DataColumn.Value.ToString() != string.Empty)
                    {
                        BindDataFromSearchFormToGrid(int.Parse(((DataRow)e.Column.DataColumn.Tag)[ITM_ProductTable.PRODUCTID_FLD].ToString()));
                    }
                    else
                    {
                        BindDataFromSearchFormToGrid(0);
                    }
                }
                if (ColName == CaptionOperation)
                {
                    if (e.Column.DataColumn.Value.ToString() != string.Empty)
                    {
                        dgrdData.Columns[ITM_BOMTable.ROUTINGID_FLD].Value = ((DataRow)e.Column.DataColumn.Tag)[ITM_RoutingTable.ROUTINGID_FLD];
                        dgrdData.Columns[CaptionOperation].Value = ((DataRow)e.Column.DataColumn.Tag)[ITM_RoutingTable.STEP_FLD].ToString();
                    }
                    else
                    {
                        dgrdData.Columns[ITM_BOMTable.ROUTINGID_FLD].Value = DBNull.Value;
                        dgrdData.Columns[CaptionOperation].Value = DBNull.Value;
                    }
                }
                int intIncrement = 0;
                if (dgrdData[dgrdData.Row, CaptionLine].ToString() == string.Empty)
                {
                    if (txtIncrement.Value.ToString() != string.Empty)
                    {
                        intIncrement = int.Parse(txtIncrement.Value.ToString());
                    }
                    if ((dgrdData.Row == 0) && (intIncrement > 0))
                    {
                        dgrdData[dgrdData.Row, CaptionLine] = intIncrement;
                    }
                    else if ((dgrdData.Row == 0) && (intIncrement == 0))
                    {
                        dgrdData[dgrdData.Row, CaptionLine] = 1;
                    }
                    else
                    {
                        if (intIncrement != 0)
                        {
                            dgrdData[dgrdData.Row, CaptionLine] = int.Parse(dgrdData[dgrdData.Row - 1, CaptionLine].ToString()) + intIncrement;
                        }
                        else
                        {
                            dgrdData[dgrdData.Row, CaptionLine] = int.Parse(dgrdData[dgrdData.Row - 1, CaptionLine].ToString()) + 1;
                        }
                    }
                }
            }
            catch (PCSException ex)
            {
                PCSMessageBox.Show(ex.mCode, MessageBoxIcon.Error);
                try
                {
                    Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxIcon.Error);
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
                }
            }
        }
        private void dtmEffectiveDate_ValueChanged(object sender, System.EventArgs e)
        {
            const string METHOD_NAME = THIS + ".dtmEffectiveDate_ValueChanged()";
            try
            {
            }
            catch (PCSException ex)
            {
                PCSMessageBox.Show(ex.mCode, MessageBoxIcon.Error);
                try
                {
                    Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxIcon.Error);
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
                }
            }
        }

        private void dgrdData_Leave(object sender, System.EventArgs e)
        {
            btnSave.Focus();
        }

        private void dtmEffectiveDate_DropDownClosed(object sender, System.EventArgs e)
        {
            const string METHOD_NAME = THIS + ".dtmTransDate_DropDownClosed()";
            try
            {
                if (dtmEffectiveDate.Text == string.Empty)
                {
                    dgrdData[dgrdData.Row, dgrdData.Col] = DBNull.Value;
                }
                else
                {
                    DateTime dtmValue = new DateTime(DateTime.Parse(dtmEffectiveDate.Value.ToString()).Year, DateTime.Parse(dtmEffectiveDate.Value.ToString()).Month, DateTime.Parse(dtmEffectiveDate.Value.ToString()).Day, DateTime.Now.Hour, DateTime.Now.Minute, DateTime.Now.Second);
                    dtmEffectiveDate.Value = dtmValue;
                }
            }
            catch (PCSException ex)
            {
                PCSMessageBox.Show(ex.mCode, MessageBoxIcon.Error);
                try
                {
                    Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxIcon.Error);
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
                }
            }
        }

        private void dtmEffectiveDate_Enter(object sender, System.EventArgs e)
        {
            const string METHOD_NAME = THIS + ".dtmEffectiveDate_Enter()", FIRSTDATE = "01-01-0001";
            const int LENGTH = 10;
            try
            {
                if ((dtmEffectiveDate.Text == string.Empty) || (dtmEffectiveDate.Text.Substring(0, LENGTH) == FIRSTDATE))
                {
                    dtmEffectiveDate.Value = DateTime.Now;
                }
            }
            catch (PCSException ex)
            {
                PCSMessageBox.Show(ex.mCode, MessageBoxIcon.Error);
                try
                {
                    Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxIcon.Error);
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
                }
            }
        }

        private void txtItemCode_Validating(object sender, System.ComponentModel.CancelEventArgs e)
        {
            const string METHOD_NAME = THIS + ".txtItemCode_Validating()";
            try
            {
                if (!txtItemCode.Modified) return;
                if (txtItemCode.Text.Trim() == string.Empty)
                {
                    if (voProduct.ProductID != 0)
                    {
                        txtBOMDes.Text = string.Empty;
                        txtIncrement.Value = 1;
                        txtModel.Text = string.Empty;
                        txtPartName.Text = string.Empty;
                        voProduct.ProductID = 0;
                        CreateTableForGrid(1);
                        dgrdData.DataSource = dstBOMDetail.Tables[ITM_BOMTable.TABLE_NAME];
                        FormControlComponents.RestoreGridLayout(dgrdData, dtbGridLayout);
                        ConfigGridLayout();
                    }
                    return;
                }
                DataRowView drwResult = null;
                Hashtable htbConditon = new Hashtable();
                if (cboCCN.SelectedValue != null)
                {
                    htbConditon.Add(ITM_ProductTable.CCNID_FLD, cboCCN.SelectedValue.ToString());
                    htbConditon.Add(ITM_ProductTable.MAKEITEM_FLD, 1);
                    if (enumAction == EnumAction.Add)
                    {
                        htbConditon.Add(v_ITMBOM_Product.HASBOM_FLD, 0);
                    }
                    else
                    {
                        htbConditon.Add(v_ITMBOM_Product.HASBOM_FLD, 1);
                    }
                }
                else
                {
                    PCSMessageBox.Show(ErrorCode.MESSAGE_RGA_CCN, MessageBoxIcon.Warning);
                    e.Cancel = true;
                    return;
                }
                drwResult = FormControlComponents.OpenSearchForm(v_ITMBOM_Product.VIEW_NAME, ITM_ProductTable.CODE_FLD, txtItemCode.Text, htbConditon, false);
                if (drwResult != null)
                {
                    GetDataOfBomFromDataRow(drwResult.Row);
                    voProduct.Code = txtItemCode.Text.Trim();
                }
                else
                    e.Cancel = true;
            }
            catch (PCSException ex)
            {
                PCSMessageBox.Show(ex.mCode, MessageBoxIcon.Error);
                try
                {
                    Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxIcon.Error);
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
                }
            }
        }

    }
}
